PDA

View Full Version : setPosition value set dynamically



sandy52
5 Mar 2014, 11:03 PM
Hi,
I want to set my window position dynamically on click event of image panel, i just want to show window after that image so how can i get the image position, my code is :



Ext.define('Usr.UX.Navigation', {
extend: 'Ext.panel.Panel',
alias: 'widget.Navigation',
border: false,
height: 75,
width: 75,
bodyCls: 'main-navigation',
initComponent: function () {


this.enableBubble('focus');
this.items = [{
xtype: 'box',
autoEl: {
tag: 'div',
cls: 'submenu-icon-image',
}
}];
this.callParent(arguments);
},


listeners: {
onBodyClick: {
element: 'body',
fn: function (e, target) {
debugger;
}
},
click: {


element: 'el', //bind to the underlying el property on the panel
fn: function (panel, record, item, index, e, eOpts) {
view = Ext.widget('NavList');
view.setPosition(item.element.getXY(), false);

}
},
},


});




Thanks & Regards,
Sandy

slemmon
13 Mar 2014, 12:11 PM
Is the below example helpful? I believe it demonstrates what you're trying to do.

48u