var tblogo = new Ext.Toolbar('north-div', [{
text : 'tbtool',
deferHeight : true,
height:10,
width:Ext.get('north-div').getComputedWidth(),
style:'background:url(/onenet/cybk/images/logo_bg.jpg) repeat-x;'
    
}]);
tblogo.render();
tblogo .add(
    {
   xtype : 'box', // 或者xtype: 'component',
       height : 25, // 图片高度
      // style:'background:url(/onenet/cybk/images/logo.jpg) repeat-x;background-color:#000000;',
       autoEl : {
        id:'myId',
        tag : 'img' ,// 指定为img标签
        src : '/onenet/cybk/images/logo.jpg' // 指定url路径
       }
});给其添加style样式,效果无效。在其他地方添加,效果正常,一直纠结不解中........求解:如何能给Toolbar增加样式控制。

解决方案 »

  1.   

    自己解决<div id='logo-div' style='height:25px;width:100%;'></div>
    var tblogo = new Ext.Toolbar({
    text : 'tbtool',
    deferHeight : true,
    //contentEl:'logo-div',
    renderTo:'logo-div',
    height:25,
    style:'background:url(../images/logo_bg.jpg) repeat-x;',
    width:Ext.get('logo-div').getComputedWidth()
    });
    tblogo.add(
        {
       xtype : 'box', // 或者xtype: 'component',
           height : 25, // 图片高度
           autoEl : {
            id:'myId',
            tag : 'img' ,// 指定为img标签
            src : '../images/logo.jpg' // 指定url路径
           }
    });