Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 页面重新加载上的filtertoolbar不进行搜索_Javascript_Jquery_Jquery Ui_Jqgrid - Fatal编程技术网

Javascript 页面重新加载上的filtertoolbar不进行搜索

Javascript 页面重新加载上的filtertoolbar不进行搜索,javascript,jquery,jquery-ui,jqgrid,Javascript,Jquery,Jquery Ui,Jqgrid,下面是我的网格代码。尝试了很多可能性。欢迎您的回复和建议。谢谢 var options = { url:inboxGridUrl, datatype: 'json', mtype: 'GET', colNames:['EvaluationId','Policy', 'Task','Status','Condition','Due Date','Eff Date','Agency Name','Agency No','Producer

下面是我的网格代码。尝试了很多可能性。欢迎您的回复和建议。谢谢

var options = {
        url:inboxGridUrl,
        datatype: 'json',
        mtype: 'GET',
        colNames:['EvaluationId','Policy', 'Task','Status','Condition','Due Date','Eff Date','Agency Name','Agency No','Producer Name','Producer No','Review Start','Location','Task Group'],
        colModel :[ 
                   {name:'uwEvaluationId', label: 'EvaluationId',formatter:'integer',editable: true,hidden:true, frozen : true,editoptions: {disabled: true, size:5}},
                   {name:'policyNum',label: 'Policy',width: 125,editable: true,formatter:formatPolicyLink,editrules: {required: true}},
                   {name:'transactionType',label: 'Task',width: 40,editable: true,editrules: {required: true}},
                   {name:'uwDecision',label: 'Status',width: 50,editable: true,edittype: 'select',editrules: {edithidden:true},editoptions: {required: true}},
                   {name:'taskCondition',label: 'Condition',align: 'left',width: 60,editable: true,
                       editrules: {required: true, integer: true},editoptions: {size:5, maxlength: 4}},
                   {name:'dueDate',label: 'Due Date',align: 'left',width: 70,editable: true,edittype: 'select',editoptions: {required: true}},
                   {name:'policyEffectiveDate',label: 'Eff Date',width: 70,editable: true,edittype: 'select',editrules: {required: true}},
                   {name:'agencyName',label: 'Agency Name',editable: true,width: 120,edittype: 'select',editrules: {required: true}},
                   {name:'agentCode',label: 'Agency No.',editable: true,width: 75,edittype: 'select',editrules: {required: true}},
                   {name:'producerName',label: 'Producer Name',width: 120,editable: true,edittype: 'select',editrules: {required: true}},
                   {name:'producerCode',label: 'Producer No',width: 75,editable: true,edittype: 'select',editrules: {required: true}},
                   {name:'startDate',label: 'Review Start',width: 80,editable: true,edittype: 'select',editrules: {required: true}},
                   {name:'locationCd',label: 'Location',width: 70,editable: true,edittype: 'select',editrules: {required: true}},
                   {name:'groupName',label: 'Task Group',width: 75,editable: true,edittype: 'select',editrules: {required: true}},
                 ],  


        prmNames: {rows: 'max', search: null},
        rowNum:20000,
        height: 'auto',

        sortname: 'id',
        sortable: true,
        forceFit : true,
        repeatitems:true,
        sortorder: 'desc',
        loadonce:true,
        shrinktofit:true,
        datatype: 'json',

        recreateForm:true,
        multipleGroup:true,
        multipleSearch:true,
        multiselect: true,

        gridview: true,
        hidegrid: false,
        viewrecords: true,      
        gridview: true,            
        refreshtitle: "Reload Tasks",
        caption: 'Inbox',
        //code to display sort icons on load
        onSortCol: function (index, idxcol, sortorder) {
            if (this.p.lastsort >= 0 && this.p.lastsort !== idxcol && this.p.colModel[this.p.lastsort].sortable !== false) {
                    $(this.grid.headers[this.p.lastsort].el).find(">div.ui-jqgrid-sortable>span.s-ico").show();
            }
        },
        loadComplete: function() {

            rowCount = $("#taskList").getGridParam("records");
            if (rowCount > 0){
                $("#warningMessage").html("");
                $("#warningBlock").hide();
                $("#recordsCount").html(rowCount);
                $("#messageBlock").show();                  
            } else if (rowCount <= 0) {
                $("#messageBlock").hide();
                $("#warningMessage").html("No Tasks Found");
                $("#warningBlock").show();
            }


        },
        ignoreCase: true,
        jsonReader : {
               root: "rows",
               page: "page",
               total: "total",
               records: "records",
               repeatitems: false,
               cell: "cell",
               id: "uwEvaluationId"
           }    ,
        postData: {filters: {groupOp: "AND", rules: [{field: "policyNum", op: "bw", data: "h" }]}} 

}; 

$("#taskList").jqGrid(options);
$("#taskList").jqGrid('navGrid','#pager',{edit:false,add:false,del:false,search:false,refresh:true});
$("#taskList").jqGrid('filterToolbar', {stringReuslt:true, searchOnEnter:false, defaultSearch:"cn", autoSearch:true 

});
var选项={
url:inboxGridUrl,
数据类型:“json”,
mtype:'获取',
colNames:['EvaluationId'、'Policy'、'Task'、'Status'、'Condition'、'Due Date'、'Eff Date'、'Agency Name'、'Agency No'、'Producer Name'、'Producer No'、'Review Start'、'Location'、'Task Group'],
colModel:[
{name:'uwealuationId',label:'EvaluationId',格式化程序:'integer',可编辑:true,隐藏:true,冻结:true,编辑选项:{disabled:true,size:5}},
{name:'policyNum',label:'Policy',width:125,editable:true,formatter:formatPolicyLink,editrules:{required:true},
{名称:'transactionType',标签:'Task',宽度:40,可编辑:true,可编辑规则:{required:true},
{name:'uwDecision',label:'Status',width:50,edittype:'select',editrules:{edithidden:true},editoptions:{required:true},
{名称:'taskCondition',标签:'Condition',对齐:'left',宽度:60,可编辑:true,
editrules:{required:true,integer:true},editoptions:{size:5,maxlength:4},
{name:'dueDate',label:'Due Date',align:'left',width:70,edittype:'select',editoptions:{required:true},
{名称:'policyEffectiveDate',标签:'Eff Date',宽度:70,可编辑:true,edittype:'select',editrules:{required:true},
{name:'agencyName',标签:'agencyName',可编辑:true,宽度:120,编辑类型:'select',编辑规则:{required:true},
{名称:'agentCode',标签:'Agency No.',可编辑:true,宽度:75,edittype:'select',editrules:{required:true},
{name:'producerName',标签:'producerName',宽度:120,可编辑:true,edittype:'select',editrules:{required:true},
{名称:'producerCode',标签:'producerno',宽度:75,可编辑:true,编辑类型:'select',编辑规则:{required:true},
{名称:'startDate',标签:'Review Start',宽度:80,可编辑:true,edittype:'select',editrules:{required:true},
{name:'locationCd',label:'Location',width:70,edittype:'select',editrules:{required:true},
{name:'groupName',label:'Task Group',width:75,edittype:'select',editrules:{required:true},
],  
prmNames:{行:'max',搜索:null},
rowNum:20000,
高度:“自动”,
sortname:'id',
可排序:是的,
forceFit:对,
重复项:对,
排序器:“desc”,
有一次:是的,
shrinktofit:是的,
数据类型:“json”,
再现形式:正确,
多组:对,
多重搜索:对,
多选:对,
gridview:没错,
希德格里德:错,
viewrecords:是的,
gridview:没错,
刷新标题:“重新加载任务”,
标题:“收件箱”,
//加载时显示排序图标的代码
onSortCol:函数(索引、idxcol、排序器){
if(this.p.lastsort>=0&&this.p.lastsort!==idxcol&&this.p.colModel[this.p.lastsort].sortable!==false){
$(this.grid.headers[this.p.lastsort].el)。查找(“>div.ui-jqgrid-sortable>span.s-ico”).show();
}
},
loadComplete:function(){
rowCount=$(“#任务列表”).getGridParam(“记录”);
如果(行计数>0){
$(“#警告消息”).html(“”);
$(“#警告块”).hide();
$(“#recordsCount”).html(行数);
$(“#messageBlock”).show();

}否则,如果(rowCount如果我理解您的意思是正确的,您需要在每次访问页面时为您的整个会话提供过滤内容。通过将postData值发送到服务器(无论您使用什么)可以轻松完成此操作将新数据列表设置到会话中,并在访问页面时再次加载数据。 在本例中,您需要使用以下值查询数据库:

groupOp: "AND", field: "policyNum", op: "bw", data: "h"
在会话中保留最后一次搜索的值,当您进入jquery document ready函数中的页面时,再次调用数据,如下所示,并用相同的数据填充网格

function fillJqgrid() {
$.ajax({
    url : "ur_url"
    type : "POST",
    async : false,
    success : function(data) {
        // Data to fill/populate your grid.
    }
});
}

希望您能获得一些指导。请告诉我这是否有助于您..

尝试保存筛选值、筛选搜索(数据),尤其是在整个会话期间我返回页面时。能够保存(重新加载)页面上的筛选值但重新加载网格时不接受筛选值。因此没有筛选搜索。需要帮助才能将filtertoolbar值发送到网格中,以便它可以根据filtercontent更改值。我不清楚您在问什么,当您有用户筛选网格时,您希望保存这些值,以便在用户返回带有网格的页面(直到会话超时?)它将记住用户应用的过滤器?我只想保存过滤条件。使用会话记住过滤条件值并不困难,但一旦在过滤器中有了这些值,使用它们触发使用jqGrid API的搜索是我无法实现的。我需要知道我们需要遵循的确切函数或步骤集在使用会话中的值重新填充jqGrid中的搜索框后,触发jqGrid搜索的可能性很低。此处的帮助将真正帮助我前进。感谢您的回复。