PDA

View Full Version : Help me figure out technique to enable/disable



rojar
30 Jul 2009, 9:14 AM
Hi

I am not able to figure best technique to enable/disable toolbar buttons based on selected row in the grid.

I have a toolbar with buttons and a grid. Based on selected row of the grid I have to enable or disable buttons in the toolbar. Toolbar can have one button or two or 3 or 5 based on the xml response from the server on page load.

One way is when user selects a row I get data of selected row and check for existence of different buttons of toolbar and if they exists enable or disable them.

Is there a way so that buttons can register for some event of grid selection and enable/disable them.

I hope i am able to explain the problem

Thanks...

tubamanu
30 Jul 2009, 10:16 AM
not sure if i understood right.....for changing icons u can use a toggle, found this in the forum

http://extjs.com/forum/showthread.php?t=3733

disabling a button is maybe so, but got no time to test it


Ext.get('myBtn').dom.disabled = true;

Condor
30 Jul 2009, 1:54 PM
Finally somebody I can point to my Easy actions (http://www.extjs.com/forum/showthread.php?t=66682) user extension!