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

ejTreeGrid does not maintain nodes state (collapsed/expanded) after updating data source list

Thread ID:





128812 Feb 10,2017 09:42 AM UTC Nov 24,2017 11:20 AM UTC jQuery 5
Tags: ejTreeGrid
Cristian Bellotto
Asked On February 10, 2017 09:42 AM UTC

I have an ejTreeGrid whose item source is binded by knockout to an observable array. Whenever I update the array by adding or removing an element the state of the treegrid nodes is not maintained. All the nodes are expanded.
How can I prevent the nodes to be expanded every time?

This is my grid definition where 'assets' is the observable array.

<div id="assetsGrid" data-bind="ejTreeGrid: {
                               dataSource: assets,
                               idMapping: 'Id',
                               parentIdMapping: 'ParentId',
                               selectedRowIndex: selectedAssetGridRow,
                               enableVirtualization: true,
                               isResponsive: true,
                               enableResize: true,
                               rowHeight: 48,
                               enableCollapseAll: false,
                               columns: [{ field: 'Code', headerText: 'Code', width: 200, verticalAlignment: 'center' },
                                         { field: 'Description', headerText: 'Description' },
                                         { field: 'WrcName', headerText: 'Wrc' },
                                         { field: 'MaterialCode', headerText: 'Material Code' },
                                         { field: 'ExternalMaterialCode', headerText: 'Ext Material Code' },
                                         { headerText: 'Docs', isTemplateColumn: true, templateID: 'viewDocsColumnTemplate', textAlign: 'center', width: 50 }
                               toolbarSettings: {
                                   showToolbar: true,
                                   toolbarItems: [
                                editSettings: {
                                    allowEditing: true,
                                    allowDeleting: true
                                toolbarClick: toolbarClick,
                                rowDataBound: assetRowDataBound

Jonesherine Stephen [Syncfusion]
Replied On February 11, 2017 05:29 AM UTC

Hi Cristian, 
At present there is no support for expand Mapping in Tree Grid. Please follow-up with the incident which is created under your account to track the status of this feature.
Jone sherine P S 

Ugur Yilmaz
Replied On November 20, 2017 02:59 PM UTC

is there a solution for this incident? 

Suriyaprasanth Ravikumar [Syncfusion]
Replied On November 21, 2017 12:27 PM UTC

Hi Ugur, 

As per your request, we have provided support for expand Mapping in TreeGrid, it already get included in our Essential studio version “”, please upgrade your source version to “” or greater than this to use this feature. 
Please refer the code snippet below. 
<div id="TreeGrid" data-bind="ejTreeGrid:{ expandStateMapping:'isExpand' ... }" style="width:100%;height:450px;"> 
var sampleData = [ 
          taskID: 1,  ... ,subtasks: [   ...   ]  
          taskID: 6,  ...  ,isExpand: false,subtasks: [   ...   ] 
We have also prepared a sample for your reference, Please find the sample link below. 

Suriyaprasanth R 

Ugur Yilmaz
Replied On November 23, 2017 08:56 AM UTC

perfect. you saved my day :) thanks.

Suriyaprasanth Ravikumar [Syncfusion]
Replied On November 24, 2017 11:20 AM UTC

Hi Ugur, 

Thank you for your update. We are glad that your requirement has been achieved.  

Suriyaprasanth R 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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