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 casper01,
Thank you for posting in the Infragistics community. I’ve been looking at your question and I put together a simple test to see if any error comes up. I’ve used our demos distributed along with the installation of jQuery product found in my C drive (C:\Program Files (x86)\Infragistics\NetAdvantage 2011.2\jQuery\demos\igHierarchicalGrid) LoadOnDemand sample. In the sample is demonstrated binding the grid to local as well to remote data source. I’ve just extended it with one button in order to refresh the data like this:
I confirm that after pressing the button to refresh the grids the grids are collapsed and then re-rendered without any issues.
In your case if you simply call $("#gridLoadOnDemand").igHierarchicalGrid("dataBind");, does it help?
If you still have any issues can you package a running sample and attach please in order to be able to investigate it further.
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.
KM
Hi Radoslav!
Thanks for your reply:)
What you recommended to try, works as you suggested. Unfortunately it's not what I want to do:)
I have two current issues that I would like to solve/work around:
ISSUE 1:
I want to implement hierarchical grid updating while visually preserving the selected/expanded/sorted rows.
For example, a user is working with a list of tasks. A task can have documents and notes attached to it. Documents and notes are child grids for each task record. A user is able to add, update and delete notes using the in-grid updating. New tasks come in on regular basis. What I want is make the grid accommodate the new tasks without collapsing any existing records and preferably not interrupting user's note edit. So the user just sees a new record come up but no other visual changes.
While I was waiting for your response I started implementing a routine that would save "state" of every record and try to restore that state for each record after calling dataBind. Please advise me if there is a better way.
ISSUE 2:
I seem to be unable to style a row when the template contains expressions.
I try to set a row template like "${formatDate(ReviewDate)}" where "formatDate(dte)" is a function present in my script. According to jQuery templating API this should work but I get and exception similar to "replace is not a valid function on the object". If use "${ReviewDate}" everything works fine.
Thank you very much for your help.
Looking forward to hearing from you soon:)