EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: officecode on November 01, 2018, 12:52:05 AM



Title: Value and selectOnNavigation in combotree
Post by: officecode on November 01, 2018, 12:52:05 AM
Code:
$('#test').combotree({
width: 200,
panelHeight:200,
value:'b',
data:[{
id:1,
text:'a'
},{
id:2,
text:'b'
},{
id:3,
text:'c'
}],
selectOnNavigation:true
});

Two questions:
1. When value is text, the tree node is not selected; however, the id can be used. Is the value only id? If I want to use text, how to achieve it?
2.selectOnNavigation works very well in combobox, but it doesn't work in combotree. Is this attribute invalid in combotree?

Thank you very much for your help, thanks again.


Title: Re: Value and selectOnNavigation in combotree
Post by: stworthy on November 01, 2018, 05:04:55 PM
Set the 'id' with the same value as 'text'.
Code:
data:[{
id:'a',
text:'a'
},{
id:'b',
text:'b'
},{
id:'c',
text:'c'
}]

The combotree has no navigation functionality with keyboard, you should extend it by yourself.


Title: Re: Value and selectOnNavigation in combotree
Post by: officecode on November 06, 2018, 08:03:17 PM
Set the 'id' with the same value as 'text'.

This is fine, but the contents of id and text are duplicates.
If only id is used, when the textField property is set to id, the contents of the tree node are still displayed as undefined:

Code:
$('#test').combotree({
width: 200,
data:[{
id:'a'
        },{
id:'b'
},{
id:'c'
}],
textField:'id',
});


Title: Re: Value and selectOnNavigation in combotree
Post by: stworthy on November 07, 2018, 01:48:47 AM
The node data requires at least 'id' and 'text' properties.


Title: Re: Value and selectOnNavigation in combotree
Post by: officecode on November 07, 2018, 08:19:38 PM
The node data requires at least 'id' and 'text' properties.
Thank you, I've now understood. I confused it with the property of the same name in combobox.