EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on November 08, 2017, 03:27:24 AM



Title: [solved] Get Datagrid Toolbar Array Object
Post by: devnull on November 08, 2017, 03:27:24 AM
Hmm, searched the documentation and forum but can't seem to find the answer.

How do I  get the linkbutton object of a datagrid toolbar array ???

Code:
$('#mydg').datagrid('options').toolbar[1].linkbutton('enable');


Title: Re: Get Datagrid Toolbar Array Object
Post by: jarry on November 08, 2017, 07:23:48 AM
Assign the 'id' property for each button.
Code:
toolbar: [{
id: 'btn-add',
text:'Add',
iconCls:'icon-add',
handler:function(){alert('add')}
},{
id: 'btn-cut',
text:'Cut',
iconCls:'icon-cut',
handler:function(){alert('cut')}
}]

And then get the linkbutton by the 'id' property.
Code:
$('#btn-add').linkbutton('enable');


Title: Re: Get Datagrid Toolbar Array Object
Post by: devnull on November 09, 2017, 10:43:46 PM
Thanks Jarry;

But I was hoping I could do it without having to assign an ID.