求解 EXTJS 3.0 这个错误:Uncaught TypeError: Cannot set property 'width' of undefined
我在做前台是用了多重表头,后来就出现了这个“Uncaught TypeError: Cannot set property 'width' of undefined”,而且每次reload那个store的时候就会出现,一直显示laodMask的情况,不知道为什么,google和baidu也查了,请高人解答//自定义双重表头
MyGridView = Ext.extend(Ext.grid.GridView, {
renderHeaders : function() {
var cm = this.cm, ts = this.templates;
var ct = ts.hcell, ct2 = ts.mhcell;
var cb = [], sb = [], p = {}, mcb = [];
for (var i = 0, len = cm.getColumnCount(); i < len; i++) {
p.id = cm.getColumnId(i);
p.value = cm.getColumnHeader(i) || "";
p.style = this.getColumnStyle(i, true);
if (cm.config[i].align == 'right') {
p.istyle = 'padding-right:16px';
}
cb[cb.length] = ct.apply(p);
if (cm.config[i].mtext)
mcb[mcb.length] = ct2.apply({
value : cm.config[i].mtext,
mcols : cm.config[i].mcol,
mwidth : cm.config[i].mwidth
});
}
var s = ts.header.apply({
cells : cb.join(""),
tstyle : 'width:' + this.getTotalWidth() + ';',
mergecells : mcb.join("")
});
return s;
}
});
viewConfig = {
templates : {
header : new Ext.Template(
' <table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',
' <thead> <tr class="x-grid3-hd-row">{mergecells} </tr>'
+ ' <tr class="x-grid3-hd-row">{cells} </tr> </thead>',
" </table>"),
mhcell : new Ext.Template(
' <td class="x-grid3-header" colspan="{mcols}" style="width:{mwidth}px;"> <div align="center">{value}</div>',
" </td>")
}
};
var activeDriverReport_grid= new Ext.grid.GridPanel( {
id:'activeDriverReport_grid',
region : 'center',
loadMask :true,
split : true,
columnLines : true,
layout:'fit',
store : activeDriverReport_store,
cm : activeDriverReport_cm,
sm: centersm,
viewConfig : {forceFit : false},
view : new MyGridView(viewConfig),
autoScroll: true,
height:600,
width:200
}
如果还需要什么代码的话可以加我qq:670500167
请高人解答。
具体问题图片在百度知道里面有,搜:“Uncaught TypeError: Cannot set property 'width' of undefined"能找到
--------------------编程问答-------------------- 都遇见同一个问题 不知楼主怎么解决的 --------------------编程问答-------------------- 楼主是怎么解决的
补充:Java , Web 开发