PDA

View Full Version : disabling or hiding some buttons



r6174
11 Mar 2014, 9:19 PM
Hi, i have a requirement in which some Authority levels plays a role..so for that i have to hide some buttons for some authorities and i have to show some buttons to them.for example let say 'A' can 'add' and 'delete' data but cannot edit so i have to show/enable 'add new' and 'delete' buttons and hide/disable 'edit' button similarly 'B' can only edit and cannot add and delete data so i have to show only 'edit' button and hide/disable 'add new' and 'delete' buttons .i have 7 authority levels distributed for each user , and their actions (like create,edit,delete...) are stored as 'true' or 'false'..how can i show and hide for all users

willigogs
12 Mar 2014, 3:40 AM
Use the button's setDisabled and setVisible methods:

http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.Button-method-setDisabled
http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.Button-method-setVisible

r6174
12 Mar 2014, 5:27 AM
Use the button's setDisabled and setVisible methods:

http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.Button-method-setDisabled
http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.Button-method-setVisible

Thanks willigogs...i got done through adding "hidden: " property for all buttons based on the status(true/false) of each authority level :D