Unable to dynamically change panel background image for IE, Chrome & Safari in extjs -
i have extjs panel desktop background. have added code dynamically change background image. in firefox working not working in of other browsers.
var panelbg = ext.getcmp('windowarea').body; var tree = ext.getcmp('desktoptree'); if (tree.getselectionmodel().hasselection()) { var selectednode = tree.getselectionmodel().getselection(); var nodeid = selectednode[0].data.id; var demo = "data/wall/"+nodeid+".jpg"; panelbg.setstyle('background-image','url('+demo+')'); panelbg.setstyle('background-size','cover'); }
please me.
thanks in advance
to change background image of panel try using setbodystyle:
var panelbg = ext.getcmp('windowarea'); var demo = "data/wall/"+nodeid+".jpg"; panelbg.setbodystyle('background:url(' + demo + ')');
i have small sample here: http://jsfiddle.net/d9zqc/3/
i've done testing in ie10, firefox 21 , chrome 26 , work ok.
cheers.
Comments
Post a Comment