EXT-Uncaught TypeError: Cannot call method 'createChild' of null ext-all.js:76解决方案
EXT---Uncaught TypeError: Cannot call method 'createChild' of null ext-all.js:76
Uncaught TypeError: Cannot call method 'createChild' of null ext-all.js:76
这是什么原因导致的 ext版本 2.0.2
<script type="text/javascript">
Ext.onReady(function(){
function check(value)
{
if (value==true)
{
return '<span style="color:red;font-weight:bold;">-</span>';
}
else
{
return '+';
}
}
var store = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
method: 'GET',
url : url
}),
reader : new Ext.data.JsonReader({
root : 'result',
totalProperty : 'totalCount',
id : 'id'
}, [ 'name','abcname','defrd','isLock'])
});
store.load({
params : {
start : 0,
limit : 10
}
});
//定义勾选框
var sm = new Ext.grid.CheckboxSelectionModel();
//定义列
var colM=new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),//增加自动编号
sm,//勾选框
{header:'用户中文名',dataIndex:'truename',width:150,sortable:true},
// 生成列,sortable为列排序,不需要设置为false,默认false,renderer为该列增加自定义函数
{header:'用户帐号',dataIndex:'username',width:150,sortable:true},
{header:'角色',dataIndex:'roleNamesAsString',width:150},
{header:'状态',dataIndex:'isLock',width:100,sortable:true,renderer:check}
]);
//生成表格
var grid = new Ext.grid.GridPanel({
renderTo:'show',
title:"表格",
height:400,
width:600,
cm:colM,
sm:sm,
store:store,
viewConfig: {forceFit:true},
bbar: new Ext.PagingToolbar({
pageSize: 10,
store: store,
displayInfo: true,
displayMsg: '共{2}条',
emptyMsg: "没有数据"
})
});
});
</script>
------解决方案--------------------
grid.Panel的整个代码要放到Ext.onReady中,按以下链接内容尝试以下
http://www.cnblogs.com/haitao-fan/archive/2013/07/05/3174470.html
Uncaught TypeError: Cannot call method 'createChild' of null ext-all.js:76
这是什么原因导致的 ext版本 2.0.2
<script type="text/javascript">
Ext.onReady(function(){
function check(value)
{
if (value==true)
{
return '<span style="color:red;font-weight:bold;">-</span>';
}
else
{
return '+';
}
}
var store = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
method: 'GET',
url : url
}),
reader : new Ext.data.JsonReader({
root : 'result',
totalProperty : 'totalCount',
id : 'id'
}, [ 'name','abcname','defrd','isLock'])
});
store.load({
params : {
start : 0,
limit : 10
}
});
//定义勾选框
var sm = new Ext.grid.CheckboxSelectionModel();
//定义列
var colM=new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),//增加自动编号
sm,//勾选框
{header:'用户中文名',dataIndex:'truename',width:150,sortable:true},
// 生成列,sortable为列排序,不需要设置为false,默认false,renderer为该列增加自定义函数
{header:'用户帐号',dataIndex:'username',width:150,sortable:true},
{header:'角色',dataIndex:'roleNamesAsString',width:150},
{header:'状态',dataIndex:'isLock',width:100,sortable:true,renderer:check}
]);
//生成表格
var grid = new Ext.grid.GridPanel({
renderTo:'show',
title:"表格",
height:400,
width:600,
cm:colM,
sm:sm,
store:store,
viewConfig: {forceFit:true},
bbar: new Ext.PagingToolbar({
pageSize: 10,
store: store,
displayInfo: true,
displayMsg: '共{2}条',
emptyMsg: "没有数据"
})
});
});
</script>
------解决方案--------------------
grid.Panel的整个代码要放到Ext.onReady中,按以下链接内容尝试以下
http://www.cnblogs.com/haitao-fan/archive/2013/07/05/3174470.html