如何使用筛选器初始化列表视图。我尝试了以下操作,但它并没有删除我之前在列表视图的搜索字段中输入的内容。
$(document).on('pagebeforeshow', '#addLocations', function() {
alert("in");
$("citynames").listview();
$("citynames").listview('refresh');
});
找到了答案。下面几行是我想要的。
$(document).on('pagebeforeshow', '#addLocations', function() {
$('input[data-type="search"]').val("");
$("[data-type=search]").trigger("change");
});