EasyUI Forum
May 04, 2024, 12:12:50 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: how can I load one dimension array data with combobox?  (Read 5666 times)
showlie
Newbie
*
Posts: 1


View Profile
« on: March 12, 2014, 07:15:46 PM »

I want to load one dimension array data without valueField and textField with combobox.like this:
$("cc").combobox({
  data:[1,2,3,4,5]
});
but it not work.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: March 13, 2014, 08:16:00 AM »

Please use 'loadFilter' function to translate the source data to standard format that can be loaded into combo box.
Code:
$('#c1').combobox({
    data:[1,2,3,4,5],
    loadFilter:function(data){
        return $.map(data, function(v){
            return {value:v,text:v}
        });
    }
})
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!