每次我加载JQGrid表时,我在顶部添加一个'div',用于在Table内搜索(已在stackoverflow中发布的解决方案):
$('#t_' + $.jgrid.jqID($grid[0].id))
.append($("<div><label for=\"globalSearchText\">Global search in grid for: " +
"</label><input id=\"globalSearchText\" type=\"text\"></input> " +
"<button id=\"globalSearch\" type=\"button\">Search</button></div>"));
搜索效果很好。问题是,如果加载页面,搜索Área将变空。有没有办法在加载页面后保留SearchText?
答案 0 :(得分:0)
You can use cookies for doing same.
See code below.
<script>
$( document ).ready(function(){
$("#gs_Customer").blur(function(){
var searchVal = $("#gs_Customer").val();
alert(searchVal);
//here you can set javascript cookies
});
$("#gs_Customer").val(searchVal); // Here you can get search text value from cookies.
});
</script>