Title: combotree initial value inside form Post by: crosemffet on December 13, 2012, 03:31:32 PM I have one combotree inside a form.
the combotree is populated with ajax request. the problem is the initial value shows the row id, not the row text. once expanded, it's fixed. what's wrong? here's the code: <form id="mainForm2" name="mainForm2" method="post"> <select id="agent" name="agent" class="easyui-combotree" data-options="url:'myurl.php',required:true,animated:false" style="width:670px;" /> </form> then: $('#mainForm2').form('load', jQuery.parseJSON(response)); response is: {"agent":"2289"} combrotree values is agent's name, i.e. 2289-john, 2290-mike combotree shows 2280, instead john. any idea...? thanks you in advance, Title: Re: combotree initial value inside form Post by: stworthy on December 13, 2012, 06:38:24 PM When you load combotree in the form with only 'id' value, this 'id' value will display on the combotree since the 'text' value can not be retrieved yet. To display desired text value, you need to prepare the 'id' and 'text' values together and call 'setText' method to set 'text' value for combotree.
Code: var data = jQuery.parseJSON(response); |