Author Topic: Prevent lazy remote loading from loading on creation until later  (Read 186 times)

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 100
    • View Profile
Using https://paramquery.com/pro/demos/infinite_scroll, I want to prevent the data being loaded after the grid has been created (it's actually not even visible as it is inside a jQuery UI dialog.

Even though the grid has been created, but is not visible, I do not want the data to load from the remote server, I want to wait until the dialog has been opened.

Is there a way to do this?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Prevent lazy remote loading from loading on creation until later
« Reply #1 on: April 29, 2024, 09:42:51 pm »
1) this example shows how to display grid in jqui dialog.

https://paramquery.com/pro//demos/fluid_popup

2) Set the initial dataModel.location to 'local'

The data can be loaded later on i.e., by click of a button or in the open event of dialog:

Code: [Select]
$("#loadData").on('click', function(){
grid.option('dataModel.location', 'remote');
grid.refreshDataAndView();
})
« Last Edit: April 29, 2024, 10:04:30 pm by paramvir »

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 100
    • View Profile
Re: Prevent lazy remote loading from loading on creation until later
« Reply #2 on: April 30, 2024, 06:58:49 pm »
Did that, but seemed to work second time ???