Hello,
I would like to use the "virtual mode" in the igGrid but I also need to retrieve the data to be virtual, retrieving one page at the time.
Is there a way I can override any method in igDataSource to make the data source virtual?
Or, is there a way I can override any method in igGrid (ie. getCellText) to be able to load the data on demand by using my own JavaScript code?
Thanks in advance!
Hi John,
There is no such functionality out of the box currently, but I think it can be easily achieved with a custom logic.Here is my suggestion:Create an instance of igDataSource bound to remote url. Configure the data source to use paging.Call igDataSource.dataBind() on the data source in order to get the first page. Bind igGrid to that data (use igDataSource.dataView() to get the data from the data source.Next you need an interface for the user to load more data to the grid. Let's have a button with caption "Load More Data…".Use this button to call the data source igDataSource.nextPage() method. Calling the igDataSource.nextPage() method will request the next chunk of data. Get the data with the igDataSource.dataView() method and add it to the grid my using the igGrid.renderNewRow() method.This approach will work for a simple grid scenario, without features. If you need more complex scenario, for example where local filtering and local sorting are used you need to use the data source of the igGrid (which you can get with this code: $("#grid1").data("igGrid").dataSource) and call its addRow() method. Then you need to rebind (call igGrid.dataBind()) the grid in order for reflect the change.
Hope this helps,Martin PavlovInfragistics, Inc.
Hi Martin,
Thank you for the quick reply.
I am trying to achive an "infinite scrolling" effect, meaning not needing to press the Next or Previous button.
http://es.infragistics.com/community/forums/t/57117.aspx
If one could override the [] operator in an Array the problem would be solved, but as far as I know, overriding the [] operator is not allowed by JavaScript. I think that if igDataSource was using something else other than the [] operator to access the data, let's say getItem(index), one could override the getItem(index) function and implement data virtualization any way we wanted.
Do you know if continuous data-virtualization is planned in the near future?