PDA

View Full Version : [CLOSED] as I can get the Id of all the buttons that are used in a web form



JCarlosF
Apr 26, 2013, 3:38 PM
I can get the Id of all the buttons that are used in a web form? all with the goal of applying permissions per user, to validate the buttons you can use

also, as could validate the gridpanel commands so that only certain users can perform these actions?

thank you very much

Daniil
Apr 26, 2013, 6:26 PM
Hi @JCarlosF,


I can get the Id of all the buttons that are used in a web form? all with the goal of applying permissions per user, to validate the buttons you can use


You can use the following code.


var btns = [];

Ext.ComponentMgr.each(function (id, c) {
if (c instanceof Ext.button.Button) {
btns.push(c);
}
});



also, as could validate the gridpanel commands so that only certain users can perform these actions?


It should be done via prepare handlers.
http://examples2.ext.net/#/GridPanel/Commands/Prepare_Commands/
http://examples2.ext.net/#/GridPanel/Commands/Prepare_Toolbar/

JCarlosF
Apr 29, 2013, 2:34 PM
Hi @JCarlosF,



You can use the following code.


var btns = [];

Ext.ComponentMgr.each(function (id, c) {
if (c instanceof Ext.button.Button) {
btns.push(c);
}
});




It should be done via prepare handlers.
http://examples2.ext.net/#/GridPanel/Commands/Prepare_Commands/
http://examples2.ext.net/#/GridPanel/Commands/Prepare_Toolbar/


ok, thanks!