Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
extjs向扩展窗口小部件的标题栏添加图标(两级扩展)_Extjs - Fatal编程技术网

extjs向扩展窗口小部件的标题栏添加图标(两级扩展)

extjs向扩展窗口小部件的标题栏添加图标(两级扩展),extjs,Extjs,我是extjs新手。。。。 我正在尝试向窗口的标题栏添加图标。 我无法找出代码中的错误 我试着在窗口中使用工具配置 这是我的密码: **Ext.ns('DEV'); DEV.ChartWindow = Ext.extend(Ext.ux.DEV.SampleDesktopWidget, { width:740, height:480, iconCls: 'icon-grid', shim:false, animCollapse:false, constrainHeader:true, layou

我是extjs新手。。。。 我正在尝试向窗口的标题栏添加图标。 我无法找出代码中的错误 我试着在窗口中使用工具配置

这是我的密码:

**Ext.ns('DEV');
DEV.ChartWindow = Ext.extend(Ext.ux.DEV.SampleDesktopWidget, {
width:740,
height:480,
iconCls: 'icon-grid',
shim:false,
animCollapse:false,
constrainHeader:true,
layout: 'fit',
initComponent : function() {

this.items = [
    new Ext.Panel({
        border:true,
        html : '<iframe src="" width="100%" height="100%" ></iframe>'
    })
];

DEV.ChartWindow.superclass.initComponent.apply(this, arguments);
},
getConfig : function() {
var x = DEV.ChartWindow.superclass.getConfig.apply(this, arguments);
x.xtype = 'DEV Sample Window';

return x;
},
tools: [{
id:'help',
type:'help',
handler: function(){},
qtip:'Help tool'
}]
});
Ext.reg('DEV Sample Window', DEV.ChartWindow);**
**Ext.ns('DEV');
DEV.ChartWindow=Ext.extend(Ext.ux.DEV.SampleDesktopWidget{
宽度:740,
身高:480,
iconCls:“图标网格”,
希姆:错,
答案:错,
对,,
布局:“适合”,
initComponent:function(){
此项。项目=[
新分机面板({
边界:是的,
html:'
})
];
DEV.ChartWindow.superclass.initComponent.apply(这是参数);
},
getConfig:function(){
var x=DEV.ChartWindow.superclass.getConfig.apply(这是参数);
x、 xtype='DEV Sample Window';
返回x;
},
工具:[{
id:“帮助”,
类型:'help',
处理程序:函数(){},
qtip:“帮助工具”
}]
});
Ext.reg(‘开发示例窗口’、开发图表窗口)**
SampleDesktopWidget是Windows的扩展

有人能帮我吗

提前感谢

我相信标题是标题的一部分。我不认为您可以通过编程方式使用initialConfig实现这一点,但您可以覆盖组件生命周期的一部分,或者使用事件进行连接。例如,将其添加到配置中。你可能(可能)在init之后的任何早期阶段都能参与进来,但这对你来说是一个实验

listeners: {
  render: {
    fn: function() {
      this.header.insert(0,{
        xtype: 'panel',
        html: '<img src="/img/titleIcon1.gif"/>'
        });
      }
   }
}
然后包含一个CSS文件,其中包含:

.myCssStyle {
   padding-left: 25px;
   background: url('/ima/titleIcon.gif') no-repeat;
}

这是一个很好的例子,使用
extjs3.2.1
可能会有所帮助

.myCssStyle {
   padding-left: 25px;
   background: url('/ima/titleIcon.gif') no-repeat;
}