-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to refresh data? #128
Comments
Are you trying to update only parts of the table? Have you tried using the |
Yes, i use them to apply new childnodes and they work perfect. I found a Would you suggest such an approach? At least it works, also from a Cheers
|
I was also trying to rebuild/refresh all elements within |
Hi guys,
i like treetable a lot, but i ran into a little issue: i need to refresh the treetable periodically, showing a status-view of some nested services.
The initial setup of the tree works fine, the table is expandable and shows the list of services in a nested structure.
The problem starts when refreshing the tree periodically looping over the services and recreating the innerHTML of the to change the status of the service. createServiceRow just creates a string containing the td-elements.
_.forEach(service,function(service) { $('#'+service.id).html(createServiceRow(service)); })
This results in completely loosing the table structure. What seems to be weird for me: the data-tt-id and data-tt-parent-id are still on the tr, but still everything is renderes as a plain table without nesting.
doing a
$('#'+tableId).treetable({expandable:true},true);
and forcing the table recreation works, but constantly collapses/expands the table.
Is the only option to force the recreation and store info about the expanded nodes to expand them after the recreation or is there a simple method to refresh table data and reflect it on the treetable?
Taking a look at how treetable renders a nested row i guess i have an explanation why this happens:
<tr id="s2" data-tt-id="s1" data-tt-parent-id="s1" class="collapsed leaf" style="display: table-row;"><td><span class="indenter" style="padding-left: 19px;"></span>nok</td><td>unknown</td></tr>
changing the innerhtml of the tr i also loose the which is created by treetable to render a nested row - but how can i prevent this? i tried to rerender the node after the refresh using treetable("node",id).render(), but that does not change anything :-( What am i doing wrong?
Thanks a lot and Cheers
Michi
The text was updated successfully, but these errors were encountered: