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',
You can do it using simple php logic.
<?php if ($user_role=='user'): ?>
disabled: true;
<?php endif; ?>
You can use any event handlers. activate( Ext.Component this, Object eOpts )
var loggedin_role = '<?php echo "$user_role"; ?>';
xtype: 'button',
listeners : {
activeate: function(btn, eOpts){
if(loggedin_role =='user') {
btn.disable();
}
}
},