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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Set the dropdown value with Fullpath delimeter ->

Thread ID:

Created:

Updated:

Platform:

Replies:

145924 Jul 14,2019 09:09 AM UTC Jul 18,2019 11:52 AM UTC jQuery 5
loading
Tags: ejDropDownTree
ASIM TAUSIF KHAN
Asked On July 14, 2019 09:09 AM UTC

Hi,
      I want to set the dropdown value with fullpath delimeter "->". i have folder tree like 
A1
    B1
        C2
        D1
    B2
    C2
    D2

and
      A1
      B1
      C1
           A2
           B2
           C2
how to set the C2 with fullpath in both scenario/

Prince Oliver [Syncfusion]
Replied On July 15, 2019 09:27 AM UTC

Hello ASIM, 

Thank you for contacting us. 

To achieve your requirement, you can use the textmode as fullpath with delimiter. Kindly refer to the following UG documentation for further reference: https://help.syncfusion.com/js/dropdowntree/textmode#textmode-with-fullpathdelimiter 

We have attached an example for your requirement, please find it in the following location: https://jsplayground.syncfusion.com/qgiu4f3w 

Let us know if you need any further assistance on this. 
 
Regards, 
Prince 


ASIM TAUSIF KHAN
Replied On July 16, 2019 01:54 PM UTC

Actually my question was that how to set full path in edit mode if the path is save like C1->C2

Prince Oliver [Syncfusion]
Replied On July 17, 2019 09:03 AM UTC

Hi ASIM, 

We could not fully get your requirement in our end. Do you mean to preselect a value and set a full path? Or do you need to get full path is some event? Kindly share us more information on your requirement. This will help us provide a prompt solution. 

Regards, 
Prince 


ASIM TAUSIF KHAN
Replied On July 17, 2019 11:29 AM UTC

yes i want to  preselect a value and set a full path

Prince Oliver [Syncfusion]
Replied On July 18, 2019 11:52 AM UTC

Hi ASIM, 

Thank you for your update. 

To preselect a value and set a full path in the DropDownTree component, you need to set the selected field in the dataSource. Kindly refer to the following code. 

<script> 
var localData = [ 
    { id: 1, name: "A1", hasChild: true }, 
    { id: 2, pid: 1, name: "B1", hasChild: true  }, 
    { id: 3, pid: 1, name: "B2" }, 
    { id: 4, pid: 1, name: "C2" }, 
    { id: 6, pid: 1, name: "D2" }, 
    { id: 8, pid: 2, name: "C2", selected: true }, 
    { id: 9, pid: 2, name: "D1" } 
]; 
$('#itemList').ejDropDownTree({ 
    treeViewSettings: { 
        fields: { id: "id", parentId: "pid", value: "id", text: "name", hasChild: "hasChild", dataSource: localData , selected: "selected" } 
    }, 
    textMode: "fullPath", 
    fullPathDelimiter: "->" 
}); 
</script> 

We have attached the modified sample for your reference, please find it in the following location: https://jsplayground.syncfusion.com/qrpzek3z  

Let us know if you need any further assistance on this. 

Regards, 
Prince 


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.

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

Live Chat Icon For mobile
Live Chat Icon