I have a button which I need to be disabled if the javascript variable is ‘user’. I am not sure how to go about it.
This is what I tried :
var loggedin_role = '<?php echo "$user_role"; ?>';
xtype: 'button',
if(loggedin_role =='user') {
disabled:true
},
text: 'Save',
Using PHP
You can do it using simple php logic.
Using ExtJS event
You can use any event handlers. activate( Ext.Component this, Object eOpts )