Hi.
I have a TreeGrid and I did some code to try to update its async data(the code is inside a wrapper object):
----------------------------------------------------------------------------
reload: function()
{
var self = this;
// Get the cols widths to apply them after reloading
this._colsWidths = [];
$(this.target).find("table colgroup col").each(function()
{
self._colsWidths.push($(this).css("width"));
});
// Open the resquest to the server
this._dm = ej.DataManager({ url: this.url });
this._q = this._dm.executeQuery(ej.Query().select("*")).done(function(e)
{
$(self.target).ejTreeGrid("option",
{
dataSource: e.result,
childMapping: self.childMapping,
treeColumnIndex: self.treeColumnIndex,
columns: self.columns
});
// Clear the table, because the widget doesn't clears it
$(self.target).find(".e-gridheader:gt(0), .e-gridcontent:gt(0)").remove();
// Apply cols widths to the new columns
var i = 0;
$(self.target).find("table colgroup col:not([style])").each(function()
{
$(this).attr("style", "width: " + self._colsWidths[i]);
i++;
});
});
As you can see it haves some hacks to clear the old data and adjust column layout because after the update the layout becomes messy. So far so good, the update works fine. The problem is after the update, the collapse and expand functions doesn't works anymore. And those hacks doesn't affect it beucase the bug happens even without them.
My question is: There is another way to update the TreeGrid async data without reloading? I mean, Am I doing it right?
I already opened
this post almost a week ago but the lack of response forced me to try by myself, but now I'm facing an internal error, so I can't carry on and my company will purchase the widget only if I make it to work. The error is below:
> Uncaught TypeError: Cannot read property 'expanded' of undefined
And the error occurs in l=f.expanded!==r.expanded; from this method t.TreeGrid.getColumnByMappingName(not so sure about the method).
I'm afraid I will have to give up of this library due to lack of documentation, forum support and features, unfortunately.