ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: jplevene on April 29, 2024, 09:19:44 pm

Title: Prevent lazy remote loading from loading on creation until later
Post by: jplevene on April 29, 2024, 09:19:44 pm
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?
Title: Re: Prevent lazy remote loading from loading on creation until later
Post by: paramvir 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();
})
Title: Re: Prevent lazy remote loading from loading on creation until later
Post by: jplevene on April 30, 2024, 06:58:49 pm
Did that, but seemed to work second time ???