EasyUI Forum
May 21, 2024, 04:24:31 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Value and selectOnNavigation in combotree  (Read 4446 times)
officecode
Jr. Member
**
Posts: 69


View Profile Email
« 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.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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.
Logged
officecode
Jr. Member
**
Posts: 69


View Profile Email
« Reply #2 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',
});
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: November 07, 2018, 01:48:47 AM »

The node data requires at least 'id' and 'text' properties.
Logged
officecode
Jr. Member
**
Posts: 69


View Profile Email
« Reply #4 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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!