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.
Unfortunately, activation email could not send to your email. Please try again.

"Maximum call stack size exceeded" when you add data source to TreeView

Thread ID:





129854 Apr 6,2017 03:57 AM Apr 11,2017 02:44 AM JavaScript 5
Tags: ejTreeView
Asked On April 6, 2017 03:57 AM


I get the "Maximum call stack size exceeded" error when I set add data source to the TreeView.

Attached example contains 2 buttons "Add valid DS" and "Add invalid DS".
Both data sources have the same structure except the second one (invalid DS) has more elements.

Valid DS works normally, but Invalid DS causes the error.
Invalid DS does not contain too many items, 38, I do not know why is this ?


Attachment: DurandalSyncfusionStarterKit_d67c711b.zip

Ashokkumar Balasubramanian [Syncfusion]
Replied On April 7, 2017 06:56 AM

Hi Milos  
We have analyzed the reported issue (“Maximum call stack size exceeded”). An issue occurs due to bind the same id for more than one node elements in treeview datasource.so please provide the different ids for each element to resolved your problem  
     "id": "3a4a446a-efa3-e511-80f5-00155d10662b",//should specify different id value for eachNode   
     "name": "Test (Beispiel)",   
     "expanded": true,   
     "pid": "1659b326-dd65-5d95-a131-1aa8a643ede1",   
Ashokkumar B.  

Replied On April 7, 2017 07:22 AM

Hi Ashokkumar,

Thank you for your quick response.
The error is not descriptive at all.
In this case where I have few elements, it is possible to find the error.
In case that I have a million elements it is impossible.

I think that that kind of error should not crash the diagram or at least we should get more descriptive error how I can easily find problematic node.


Ashokkumar Balasubramanian [Syncfusion]
Replied On April 10, 2017 07:41 AM

Hi Milos, 
Thanks for your reply. 
We are unable to handle the datasource related validation process in TreeView component, because it is not formal one. Please use the below code block to validate the datasource before bind it into treeview component. 
var ids = []; 
var collection = []; 
$.each(invalidDataSource, function(index, value) { 
       if($.inArray(value.id, ids) == -1) //check if id value not exits in other objects than add it 
Ashokkumar B. 

Replied On April 10, 2017 08:49 AM

Hi Ashokkumar,

Thank you.
Custom method for datasource validation can help here.
I do not have further questions regarding this issue.


Ashokkumar Balasubramanian [Syncfusion]
Replied On April 11, 2017 02:44 AM

Hi Milos, 
Okay, Most Welcome. 
Ashokkumar B. 


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.

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.