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.

How is sort order handled?

Thread ID:

Created:

Updated:

Platform:

Replies:

130231 Apr 30,2017 08:55 AM May 1,2017 08:14 AM ASP.NET Web Forms 1
loading
Tags: TreeView
Armand De Lange
Asked On April 30, 2017 08:55 AM

Hi

I want to sort nodes by a separate integer sort order field in die database, how can it be done?

What data field is used to handle sort in the treeview object?

THX
Armand 

Karthik Ravichandran [Syncfusion]
Replied On May 1, 2017 08:14 AM

Hi Armand, 
 
Thanks for contacting Syncfusion support. 
 
 
We have checked your query (“How is sort order handled”). You can achieve your requirement by using sortSettings API in ejTreeView.  you can sort the treenodes node by its node text Please refer the below code snippet. 
 
 
$("#treeView").ejTreeView( 
{ 
    fields: { id: "id", parentId: "pid", text: "name", hasChild: "hasChild", dataSource: localData, expanded: "expanded" }, sortSettings: { 
        allowSorting: true, 
        sortOrder: ej.sortOrder.Ascending 
    } 
} 
); 
 
To achieve this with your custom field, you should map the custom field as a node Text. 
 
For your convenience, we have attached the sample below, 
 
 
To know more details about ejTreeView, please refer the below documentation link. 
 
 
 
 
Please let us know if you need further assistance on this. 
 
Regards, 
Karthik 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.

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.

;