EasyUI Forum
June 20, 2024, 10:57:21 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: combotree don't show default value on tree panel  (Read 3008 times)
china-ding
Newbie
*
Posts: 2


View Profile
« on: April 07, 2019, 11:24:45 PM »

when I use combotree,I need 2 step.
1.get tree data by ajax from server.
2.set the combotree default value.

now the question is :
default value is response by MVC DataBag,in HTML,it just a string,like <input...value='Java' />
,but the server is too slow,the ajax need some second.
when I show the tree panel,the default value don't show "item-selected" in the tree panel.

I think a way that set the default value in event window.load(),and it worked! but when the combotree in datagrid's editor,I can't set it.
I think when set default value, tree item has not create, so tree can't set class "item-selected".
Logged
jarry
Administrator
Hero Member
*****
Posts: 2266


View Profile Email
« Reply #1 on: April 07, 2019, 11:45:27 PM »

When calling 'setValue' method to set the combotree's value, you can pass it an object that contains the 'value' and 'text' properties to initialize the value and the displaying text on the inputing box.

Code:
$('#ct').combotree({
//...
});
$('#ct').combotree('setValue',{id:111,text:'Friend'})
Logged
china-ding
Newbie
*
Posts: 2


View Profile
« Reply #2 on: April 09, 2019, 04:43:42 AM »

yes,it worked!
thank you.
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!