ParamQuery grid support forum

General Category => ParamQuery Pro Evaluation Support => Topic started by: Arun Singh on February 19, 2017, 03:35:22 pm

Title: Change Col Model and Data of param query grid aar once
Post by: Arun Singh on February 19, 2017, 03:35:22 pm
Hi,

I am populating the pq grid on ajax success. I am able to refresh the data and view at once. But if user has scrolled the grid horizontally, the next refresh is not displaying the grid data and header. Sample code is :

/** check for existing instance, if present then change col model,data*/
   if($demoPQGrid.pqGrid('instance')){
   
      //refresh grid data and view
      $demoPQGrid.pqGrid( "option" , "colModel",pqGridColumns);
      $demoPQGrid.pqGrid( "option" , "dataModel.data",jsonData.data );
      $demoPQGrid.pqGrid("refreshDataAndView");
      $demoPQGrid.pqGrid("option", "selectionModel.type", null);
      
      var pqGridProperties  = fnSetGridProperties(jsonData.data,pqGridColumns);
      
   /** render grid */
      $demoPQGrid.pqGrid(pqGridProperties);
   }
var pqGridProperties = {
           height: fnGetDocHeight() - fnGetDocHeight() * percentHeightPqGridDivWrapper / 100,
           resizable:true,
           showTop:false,
           showToolbar : false,
           showBottom: false,
           virtualX: true,
           rowBorders:true,
           columnBorders:true,
           virtualY: true,
           virtualXHeader: true,
           virtualYHeader: true,
           colModel: pqGridColumns,
           filterModel: { on: true, mode: "AND", header: true },
           location: "local",
               sorting: "local",
               hwrap:false,
               wrap:false,
          dataModel: {data: pqGridData}
       };
Title: Re: Change Col Model and Data of param query grid aar once
Post by: paramvir on February 20, 2017, 09:59:38 am
Not sure what kind of requirement makes you change colModel and data on horizontal scroll, please share a complete sample of your code via jsfiddle so that I can look into it.