EasyUI Forum
May 01, 2024, 07:21:25 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: Datagrid toolbar by array  (Read 973 times)
Wojak
Newbie
*
Posts: 48


View Profile Email
« on: December 06, 2023, 03:26:59 PM »

Hi,
Is there a better way to create toolbar with combobox as array then this?
Code:
var toolbar = $('<div style="padding:2px 4px"></div>').appendTo('body');
var db = $('<input>').appendTo(toolbar);
db.datebox();
var cb = $('<input>').appendTo(toolbar);
cb.combobox();

$('#dg').datagrid({
    toolbar:toolbar
})

I have made something like this, but it only works for a non easyui
Code:
{ text: 'Filter: <select id="test"><option value="1">1</option><option value="2">2</option></select>' }

Also in datagrid code i found that every thing in array that is not a "-" it mades as .linkbutton

Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: December 12, 2023, 08:33:11 PM »

The combobox component can be attached to the toolbar. Please refer to the code below. Make sure to download the latest version.
Code:
var toolbar = [{
text:'Add',
iconCls:'icon-add',
handler:function(){alert('add')}
},{
text:'Cut',
iconCls:'icon-cut',
handler:function(){alert('cut')}
},'-',{
text:'Save',
iconCls:'icon-save',
handler:function(){alert('save')}
},'-',{
type:'combobox',
data:[{value:'1',text:'text1'},{value:'2',text:'text2'}],
editable:false,
onChange:function(value){
alert(value)
}
}];
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!