I've found this example for "Load on Demand - loadTrigger: auto" at: https://www.igniteui.com/grid/load-on-demand.
In the link they bind the static datasource, Is there anyway to bind the custom dynamic datasource before grid auto trigger everytime? Like when I scrolling the grid then call my service to get the dynamic data then igGrid bind my dynamic data to the grid
Thank you.
hi Martin,
I have created another post for clarity.
http://ko.infragistics.com/community/forums/p/88078/437959.aspx#437959
Thanks for your inputs
Rajesh
Hello Rajesh,
Rajesh Varade said:Can you please let me know what gird events are fired after igGrid LoadOnDemand is triggered and completed?
The LoadOnDemand events are described here:
http://help.infragistics.com/jQuery/2013.2/ui.iggridloadondemand#events
Rajesh Varade said:I am trying to catch iggridrowsrendered event after load on demand and not able to hit it.
What is the code you're using?
Rajesh Varade said: Can you please throw some light on this? I am struggling to make SelectionPersistense.js work with load on demand. The restoreSelection() function of this .js file is tied with iggridrowrendered.
Can you please throw some light on this?
I am struggling to make SelectionPersistense.js work with load on demand. The restoreSelection() function of this .js file is tied with iggridrowrendered.
I guess that you know that you first need to enable the selection persistence with the code like this:
$(document).on("iggridrendered", "#grid1", function rendered (evt, ui) { sp = SelectionPersistence(ui.owner); sp.enableFiltering(); });
This code needs to be executed before the grid is initialized.
The iggridrowsrendered event will be thrown only when the grid is created or data bound. When user presses the "Load more data" button the igGridLoadOnDemand.rowsRequesting and igGridLoadOnDemand.rowsRequested events are fired sequentially.
From what I see the SelectionPersistence code will work without the need for modifications.
P.S.: About your previous post:
Rajesh Varade said: I am still not able to trigger the LoadOnDemand. But when I execute filter feature for at least once, after that LoadOnDemand works fine. But for the first time it does not work.
I am still not able to trigger the LoadOnDemand.
But when I execute filter feature for at least once, after that LoadOnDemand works fine. But for the first time it does not work.
I was not able to reproduce the behavior you describe. Your code looks Ok except that the autoGenerateColumns = false, but there are no columns defined.
Overall I'm not sure what you're trying to achieve, because your sample code shows one set of features, but then you're talking about a different set of features.
Next time, please open a new thread, because this thread discussion was created for a different scenario from yours.
Hope this helps,Martin PavlovInfragistics, Inc.
Hello Martin,
Can you please let me know what gird events are fired after igGrid LoadOnDemand is triggered and completed?
I am trying to catch iggridrowsrendered event after load on demand and not able to hit it.
Thanks,
Hi Martin,
Thanks for the quick fix.
I have below code now
<script> $.ig.DataSource.prototype.settings.paging.pageIndexUrlKey = "page"</script> @(Html.Infragistics().Grid(Model.Customers.AsQueryable()) .Width("400px") .Height("300px") .AutoGenerateColumns(false) .ResponseDataKey("Records") .Features(feature => { feature.Filtering().Type(OpType.Remote); feature.LoadOnDemand().ChunkSize(10).LoadTrigger(LoadTrigger.Button); }) .DataSourceUrl(Url.Action("GetAllC")) .DataBind() .Render() )
Can you please let me know how do I make it work without using filter once.
Also the above fix has resolved one more problem for me, now after filtering is used at least once, grid is not filled with whole data. It is filled with only ChunkSize of LoadOnDemand Feature.
Thanks
Rajesh Varade
There is a small issue in LoadOnDemand when used in the Grid MVC wrappers. It sends oData parameters instead of the default MVC ones. I logged this and fixed it, so it will be available in the next 13.2 SR.
The workaround again is to directly modify the igDataSource prototype (keep in mind that this is a global change, so it may affect other grids on the page). Here is the code:
$.ig.DataSource.prototype.settings.paging.pageIndexUrlKey = "page";
This code should be executed before the grid is initialized and after infragistics.datasource.js file is loaded. You can of course return the pageIndexUrlKey back to its original value after the grid is created.