EasyUI Forum
May 03, 2024, 11:52: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: Add Combo Option  (Read 7138 times)
arma
Full Member
***
Posts: 110


View Profile
« on: December 04, 2013, 04:29:41 PM »

Hi,

Is there a way to add a combobox option manually into combobox which load data with url property ?

Code:
$('#cb-product-option-pattern').combobox({
                        url: 'product/option/pattern',
                        editable: false,
                        valueField: 'id',
                        textField: 'text',
                        multiple: true,
                        panelHeight: 'auto',
                        width: 425
                    });

//Add some option here to combobox above manually from local data

Thanks.
Logged
iceh
Jr. Member
**
Posts: 61


View Profile
« Reply #1 on: December 05, 2013, 04:25:25 AM »

I suggest using the $.ajax() of jquery, then you can filter your data
and apply the rest to the cb via the .data property.

e.g.

var data = ... from ajax

the filter ...

now data has e.g.

data = " [{
         label: 'java',
         value: 'Java'
      },{
         label: 'perl',
         value: 'Perl'
      },{
         label: 'ruby',
         value: 'Ruby'
      }]";

$('#cc').combobox({
   data: 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!