jquerymobile listview事件-应用过滤器后剩余的项目数 [英] jquerymobile listview events - number of remaining items after filter applied
本文介绍了jquerymobile listview事件-应用过滤器后剩余的项目数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试找到一种简便的方法来检查在过滤列表后还剩下多少列表项.
I'm trying to find an easy way to check how many list items are left after a list has been filtered.
在通过过滤列表时,我可以接听
I can pick up when the list is being filtered via
$("#theList").listview('option', 'filterCallback', function( text, searchValue ) {
//how many list items are there??
return text.toLowerCase().indexOf( searchValue ) === -1;
});
有没有简单的方法可以做到这一点?如果可能的话,我真的希望挂接到应用了过滤器的事件上. 没有足够的文档运气,因此对您的帮助表示赞赏.
Is there an easy way to do this? I'm really looking to hook onto a filter applied event if possible. Not having much luck with the docs so any help appreciated.
推荐答案
要计算剩余的li显示量,请使用:visible"的伪选择器,如下所示...
To count the remaining li showing, use the psudo-selector of ":visible" like this...
$(#theList li:visible").length
$("#theList li:visible").length
这篇关于jquerymobile listview事件-应用过滤器后剩余的项目数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文