Top of the evening to you!!
I'm currently evaluating the hierarchical grid and I'm stuck trying to implement a simple data source refresh.
I'm using json as data source for the grid. I then have handlers for events like adding a row and updating a row, etc. That works fine. I'm not using/interested in the transactional operations.
What I have to implement is regular updating of the grid data. I get new json every 30 seconds but when I try to use dataSourceObject option of the grid nothing happens. If I call dataBind after setting new data source I get exceptions (i.e. "length is null or undefined"). (I only get this exception when one of the grid records is in expanded state).
Is there an example of how to achieve refreshing of the grid data source after the grid has been initialised? WIll I have to put in logic to expand/reselect the records to hide the refreshing from the user?
Any help is super greatly appreciated:)
Kyryll
Hello KOK MANG TANG ,
If you’re using KnockoutJS then I recommend that you also take advantage of our knockout js extensions , which support KnockoutJS bindings with the igHierarchicalGrid widget.
You can refer to the following sample from our samples browser, which demonstrates the configuration for achieving two-way data-binding between your model and the grid:
http://www.igniteui.com/hierarchical-grid/bind-hgrid-with-ko
Note that if anything in the model changes then the grid will automatically reflect the changes.
Let me know if you have any questions.
Best Regards,
Maya Kirova
Infragistics, Inc.
http://es.infragistics.com/support
OKay i am able to make it working by assign the same data source file again:
$("#my_table").igHierarchicalGrid('option', 'dataSource', <myknockoutarray>); $("#my_table").igHierarchicalGrid("dataBind");
Not sure if there is any other better solution?
Thanks,
KM
Hello Rado:
I am looking for igHierarchicalGrid refresh function and I found this post.
I am using knockout observableArray to bind to igHierarchicalGrid datasource.
When the Json data in my observableArray has been changed, i tried to call:
$("#my_table").igHierarchicalGrid("dataBind");
But the my UI didn't get refresh. The table still showing the old data.
Anything that i missed out?
I am using IgniteUI.Free -Version 13.1.20131.2292.
Appreciate for your reply.
Hi Kyryll,
I've got a word from our developers and it turns out to be not support feature for now.
Have you checked my example? Let me know if you need further assitance with this matter.