extjs - Inserted image on panel's placeholder not rendering correctly -
i have weird problem regarding xtype: 'image' component added using insert() in panel's placeholder:
panel:
{ xtype: 'panel', collapsed: true, region: 'east', collapsible: true, split: true, . . . listeners: { afterrender: function (panel) { if (panel.placeholder) { panel.placeholder.insert(1, { xtype: 'image', src: 'myimage.png', margin: '10 0' } ); panel.placeholder.settitle(''); } } } } so problem is, icon added in placeholder not being displayed correctly, left being set @ 9px, when should 0:
but after expanding said panel , collapsing again, image correctly displayed. have been cause? doing insert correctly?
note: margin config image being used extjs position element. however, left property of image being set @ 9px. have tried: margin: '10 0 10 0' or margin: '10 5' nor margin: '10 5 10 5' still image being set left: 9px makes me think l/r margins not being accounted for. when setting margin: 10, l/r margins being accounted.
edit: here's working fiddle reference, per @tejas1991 request.
try running fiddle. can notice, image of east panel not correctly positioned. now, try expanding panel , collapse again. voila!
well, seems have provide width of image in order correctly added placeholder.
panel.placeholder.insert(1, { xtype: 'image', src: 'myimage.png', margin: '10 0', width: 25 }); 
Comments
Post a Comment