EasyUI Forum
April 28, 2024, 10:55:30 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: Use customized id or text field name for ComboTree  (Read 9647 times)
nesson
Newbie
*
Posts: 1


View Profile
« on: April 30, 2014, 12:17:07 AM »

Hello there,

While we were testing on combotree, we found there isn't a function or property to customize 'id' or 'text', like combobox there are properties 'valueField' and 'textField' to indicates using which json obj to render text field or value field, so here we have to make the returned json data exactly matches {id :xx, text: xx} format, but our returning data is something like {u_id: xx, u_name: xx}. is there any suggested way to solve this problem rather than do a data conversion?

Thank you
Nesson
« Last Edit: April 30, 2014, 12:20:09 AM by nesson » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: April 30, 2014, 01:43:41 AM »

The 'loadFilter' function can be used to convert your data to the standard tree data.
Code:
$('#cc').combotree({
  loadFilter: function(data){
    // return the filtered data
  }
});
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!