[英]Search filter not reset jquery mobile
I have added a the search filter attribute to my jquery mobile app like this: 我向我的jquery移动应用程序添加了一个搜索过滤器属性,如下所示:
data-filter="true"
When i type in the search bar and it automatically filters the posts I need, I click on one of the articles but when I return back to homepage it only displays the filter and not reload the entire content. 当我在搜索栏中键入内容并自动过滤我需要的帖子时,我单击了其中一篇文章,但是当我返回首页时,它仅显示过滤器,而不会重新加载整个内容。
The is my homepage button code: 这是我的首页按钮代码:
<li><a href="#blog" class="p_ft">Home</a></li>
How do I get around this. 我该如何解决。
Thanks 谢谢
You could reset the filter every time the homepage is about to be shown: 您可以在每次显示主页时重置过滤器:
$(document).on("pagebeforeshow", "#blog", function() {
$(this).find(".ui-listview-filter input").val("").trigger("change");
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.