PDA

View Full Version : add style to panel when click event fire on panel



sandy52
26 Feb 2014, 10:19 PM
Hi,
I want to add zindex style to my panel when i click on that panel, how can i do this my code is


Ext.define('LIB.UX.MainNavigation', {
requires: ['LIB.UX.ZIndexManager'],
extend: 'Ext.panel.Panel',
alias: 'widget.MainNavigation',
border: false,
height: 75,
width: 75,
bodyCls: 'main-navigation',
initComponent: function () {

this.enableBubble('focus');
this.items=[{
xtype: 'box',
autoEl: {
tag: 'div',
cls:'submenu-spoon-icon',
}
}];
this.callParent(arguments);
},
listeners: {
click: {
element: 'el',
fn: function(panel, record, item, index, e, eOpts) {
var view = Ext.widget('NavList');

if (view.isVisible()) {
view.hide();
} else {
// i want to add zindex style to MainNavigation
view.show().setPosition(75, 20, false);
}


Ext.select('.x-mask').addListener('click', function () {
view.close();
});
}
},
},

});


Thanks & Regards,
Sandy

Zinnia
26 Feb 2014, 10:59 PM
Hi Sandy,
Check the below code , hope this may help you. 48088

sandy52
28 Feb 2014, 1:28 AM
Hi Zinnia,
Thanks for your reply but i want to give styling to panel before show().setPosition().

Thanks & Regards,
Sandy