Author Topic: ParamQuery Pro: RefreshView is taking long time to update the records.  (Read 5361 times)

magfi.1234

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 12
    • View Profile
Hi,

We are using Param Query Grid Inside Iframe and updating records in the grid is fast as expected. We just migrated to Param query pro and observe that it is taking long time to update the records and also the Iframe is responding very slow on mouse click if we load grid with more than 3000 records. Below is code we used to update the records in the database.

searchUsrGrid.pqGrid("option", "dataModel.data", users);
searchUsrGrid.pqGrid("refreshView");

Quick help is appreciated as we have release in coming weeks.

Thanks
Magfirulla

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Virtual mode is the performance mode which can be enabled by simply setting the 2 properties virtualX & virtualY to true.

API Ref:

http://paramquery.com/pro/api#option-virtualY
http://paramquery.com/pro/api#option-virtualX

Example:

http://paramquery.com/pro/demos/infinite

Please let me know whether it fixes your issue.
« Last Edit: July 02, 2015, 03:02:42 pm by paramquery »

magfi.1234

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 12
    • View Profile
Thank you so much. It resolved the issue.

magfi.1234

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 12
    • View Profile
Hi,

The option Virtual and Virtual Y resolved the issue. But this fix is creating one more issue. The grid some times may have very less data. In this case if you scroll, the vertical scroll bar gets invisible and we no longer able to scroll up or down.

It can be reproducible in demo below. Just modify number of rows to 12. Then scroll. The vertical Scroll bar gets hidden.

http://paramquery.com/pro/demos/infinite

Thanks
Magfirulla

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Please add this temp fix in the refresh event / callback.


         refresh: function(evt, ui){
               var $grid = $(this),
                  virtualY = $grid.pqGrid('option', 'virtualY'),
                  length = $grid.pqGrid('pageData').length,                           
                  val = (length > 20);//any cutoff number in place of 20

               if(val !== virtualY){                  
                  $grid.find(".pq-sb-vert").pqScrollBar("option", "steps", val);
                  $grid.pqGrid('option', 'virtualY', val).pqGrid( 'refresh' );
               }            
         }
« Last Edit: July 07, 2015, 09:14:08 pm by paramquery »

magfi.1234

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 12
    • View Profile
Thank. It resolved the issue.