EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Fabrice on August 07, 2023, 02:58:22 AM



Title: datagrid and toolbar
Post by: Fabrice on August 07, 2023, 02:58:22 AM
I have an accodion object with ten datagrids, each datagrid has a toolbar with two buttons.
i would like to use only one toolbar for all datagrids, so i don't want to give an "id" to these buttons.
how can i programmaticaly change iconCls of a button when an external event occurs if i don't know id of button but i know id of his datagrid.
Same question in handler of the button, i need to know id of his datagrid.



Title: Re: datagrid and toolbar
Post by: jarry on August 13, 2023, 11:49:42 PM
Please call this code to get the toolbar bound to the datagrid. And then you will be able to access the buttons in the toolbar.
Code:
var tb = $('#dg').datagrid('options').toolbar;
...