Author Topic: Change Col Model and Data of param query grid aar once  (Read 2914 times)

Arun Singh

  • Newbie
  • *
  • Posts: 3
  • Arun Singh
    • View Profile
Change Col Model and Data of param query grid aar once
« 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}
       };

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Change Col Model and Data of param query grid aar once
« Reply #1 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.