重新加载页面后,JqxGrid 过滤器丢失

问题描述

我正在处理一个概览页面,我在其中使用 JqxGrid 显示我们公司中的所有项目。您可以单击一个项目转到下一个页面,您可以在其中查看该项目的详细信息。如果您在概览页面中设置过滤器并转到详细信息页面,您将丢失此过滤器。这不是最用户友好的。我想知道是否有人知道我如何防止这种情况发生?我已经尝试过 jq cookie,但它似乎不起作用。

$(document).ready(function () {
    var sourcePO =
    {
      datatype: "xml",datafields: [
        { name: 'Name',type: 'string'},{ name: 'ID',{ name: 'Manufacturer',{ name: 'Application',{ name: 'Version',{ name: 'Status',{ name: 'Product',{ name: 'Requester',type: 'string'}
      ],root: "Data",record: "record",id: 'id',url: "Data.xml",};

    var dataAdapterPO = new $.jqx.dataAdapter(sourcePO);
    var DocumentHeight = $(document).height();
    $("#jqxgridPO").jqxGrid(
      {
        theme: 'metro',width: '100%',height: (DocumentHeight - 250),source: dataAdapterPO,showfilterrow: true,filterable: true,sortable: true,selectionmode: 'singlerow',columnsresize: true,columns: [
          { text: 'Name',filtertype: 'textBox',datafield: 'Name',width: '11%' },{ text: 'ID',datafield: 'ID',{ text: 'Manufacturer',datafield: 'Manufacturer',{ text: 'Application',datafield: 'Application',{ text: 'Version',datafield: 'Version',width: '4%' },{ text: 'Status',filtertype: 'checkedlist',datafield: 'Status',width: '7%' },{ text: 'Product',datafield: 'Product',{ text: 'Requester',datafield: 'Requester',width: '10%' },]
      }
    );
        
          $("#jqxgridPO").on("rowdoubleclick",function (event) {
              var data = $('#jqxgridPO').jqxGrid('getrowdata',event.args.rowindex);
              window.location.assign("../Productdetail.PHP?id=" + data.Name +  data.ID);
          });

有人知道我在点击产品并前往产品网页后如何保留过滤器吗?特别是复选框类型过滤器。

谢谢!

解决方法

为什么不让您的页面只隐藏网格并在 Modal JQXWindow 中显示产品详细信息,当模态窗口关闭时,再次显示您的网格。