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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Updating TreeGrid data breaks expand/collapse actions

Thread ID:

Created:

Updated:

Platform:

Replies:

117622 Nov 18,2014 11:40 AM UTC Nov 20,2014 11:52 AM UTC JavaScript 3
loading
Tags: ejTreeGrid
Márcio Chaves
Asked On November 18, 2014 11:40 AM UTC

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.

John Rajaram [Syncfusion]
Replied On 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


Márcio Chaves
Replied On 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.

John Rajaram [Syncfusion]
Replied On 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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;