setPriority()有时似乎不触发startAt().endAt().on("child_added") [英] setPriority() sometimes don't seem to fire startAt().endAt().on("child_added")

查看:54
本文介绍了setPriority()有时似乎不触发startAt().endAt().on("child_added")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些区域将 on("child_added") startAt() endAt()一起使用.

  rootRef.startAt(0).endAt(1).on("child_added",function(snapshot){...});rootRef.startAt(10).endAt(20).on("child_added",function(snapshot){...}); 

然后使用 setPriority() setWithPriority()将项目从一个区域移动到另一个区域.某些情况下"child_added"被解雇了,但其他一些情况没有被解雇.

在jsfiddle尝试一个示例. http://jsfiddle.net/Q9SJv/16/

您可能会看到:

移动 12 -> 0.2 将添加到 startAt(0).endAt(1).on("child_added"

移动 12 -> 0.8 不会添加到 startAt(0).endAt(1).on("child_added"

解决方案

感谢您的报告.这绝对是我们这方面的错误.我已将其连同重新复制步骤保存在我们的内部跟踪器中.可能要过一会儿,但我们会修复它.

同时,如果该位置没有大量数据,则可以在rootRef上使用值事件.

希望有帮助!

Use on("child_added") with startAt() and endAt() for some regions.

rootRef.startAt(0).endAt(1).on("child_added", function(snapshot) {...});
rootRef.startAt(10).endAt(20).on("child_added", function(snapshot) {...});

And move an item from a region to another using setPriority() or setWithPriority(). Some cases "child_added" fired, but some other cases didn't fire.

Try an example at jsfiddle. http://jsfiddle.net/Q9SJv/16/

You may see that:

Move 12 -> 0.2 will be added in startAt(0).endAt(1).on("child_added"

Move 12 -> 0.8 won't be added in startAt(0).endAt(1).on("child_added"

解决方案

Thanks for the report. It's definitely a bug on our end. I've filed it in our internal tracker, along with steps to repro. It may be a little while, but we will fix it.

In the meantime, if there's not a ton of data at that location, you could use value events at rootRef.

Hope that helps!

这篇关于setPriority()有时似乎不触发startAt().endAt().on("child_added")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆