PDA

View Full Version : When my desktop buttons are displayed, they think they are at (0, 0), but they aren't



Elfayer
11 Jul 2012, 8:05 AM
Hi,
I don't know how and why all my desktop buttons think they are at (0, 0) at the beginning (when i displayed it), but they aren't.

37072

Button or Icon :

Ext.define('DSK.view.desktopCenter.shortcut', {
extend: 'Ext.button.Button',
alias: 'widget.shortcut',

overCls: 'iconeOver',
width: 100,
height: 100,
style: {
background: 'none',
border: 'none'
},
draggable: true
})

I display them on the controller via a database.

Is that normal ?
Can someone help me to fix it ?
Tell me if you need more details.

tvanzoelen
11 Jul 2012, 8:09 AM
On what kind of component you have placed the buttons on? Whats its layout?

Elfayer
11 Jul 2012, 11:37 PM
They are in the panelCenter :


Ext.define('DSK.view.desktopCenter.panelCenter', {
extend: 'Ext.panel.Panel',
alias: 'widget.panelCenter',

cls: 'panelCenter',
region: 'center',
border: false
})

So it has the default layout : Auto. (I tried to change it, i tried all layouts, but it never changed the problem.)

tvanzoelen
11 Jul 2012, 11:43 PM
Well absolute layout should display its content absolute.



layout: {
type: 'absolute'
// layout-specific configs go here
//itemCls: 'x-abs-layout-item',
},


And then specify a x and an y property on the buttons.