We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Updating TreeGrid data breaks expand/collapse actions

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.

3 Replies

JR John Rajaram Syncfusion Team November 19, 2014 11:23 AM UTC

Hi Márcio,

 

We have created a new incident #132204 on behalf of you related to this forum. We suggest you to follow up the incident for further reference using your direct trac account.

 

Please let us know if you have any questions.

 

Regards,

John. R



MC Márcio Chaves November 19, 2014 11:28 AM UTC

Hi John.

Yeah I received the incident opening e-mail. I appreciate. I just want to know if you guys just opened it to have a better tracking or I was found a real issue regarding what I posted?

Thank you again.


JR John Rajaram Syncfusion Team November 20, 2014 11:52 AM UTC

Hi Márcio,

We have created a new incident for having a better tracking of the issue and also our support policy is to provide a patch for the issue only through incidents. We also let you know that we consider issues from forum and incidents as the same. So we request you to follow up the incident for further reference which would be helpful for us to serve you better.

Please let us know if you need more information on this.

Regards,
John. R


Loader.
Live Chat Icon For mobile
Up arrow icon