EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: korenanzo on December 28, 2015, 07:56:24 AM



Title: how to add keydown event to toolbar buttons
Post by: korenanzo on December 28, 2015, 07:56:24 AM
Hi,
I use buttons properties to add buttons to my pagination toolbar , according to the manual:

http://www.jeasyui.com/documentation/index.php#
Code:
$('#pp').pagination({
  buttons: [{
iconCls:'icon-add',
handler:function(){alert('add')}
},'-',{
iconCls:'icon-save',
handler:function(){alert('save')}
}]
});


I need to add keydown evento to the buttons: is it possible?

Thanks,

RIk


Title: Re: how to add keydown event to toolbar buttons
Post by: stworthy on December 29, 2015, 02:27:40 AM
Please try this:
Code:
$('#pp').pagination({
  buttons: [{
  id:'btn-add',
iconCls:'icon-add',
handler:function(){alert('add')}
},'-',{
id:'btn-save',
iconCls:'icon-save',
handler:function(){alert('save')}
}]

});
$('#btn-add').bind('keydown',function(e){
//...
})