Hi,
I have the ojTable and ojRowexpander, now I want to refresh it when the data changes.
The ojTable data binding is like this:
self.tableData = ko.observable();
var options = [];
self.tableData(new oj.FlattenedTreeTableDataSource(
new oj.FlattenedTreeDataSource(
new oj.JsonTreeDataSource(data), options)
));
When I want to refresh the table data, I can use
self.tableData(new oj.FlattenedTreeTableDataSource(
new oj.FlattenedTreeDataSource(
new oj.JsonTreeDataSource(newData), options)
));
which works fine. Now the problem is, it actually re-draw the whole table and rowexpander, for example, if I expand some rows in the table, and I use this method to refresh it, the data refreshed but these rows collapse again. I want the row expanded as before, just the data changes refresh.
I also tried to use refresh method:
$( ".selector" ).ojRowExpander( "refresh" );
$(".ojRowExpander").trigger("refresh");
$( ".selector" ).ojTable( "refresh" );
$(".ojTable").trigger("refresh");
None of these works,
What should I do now?
Thank you!