extjs 代码出错~报错:b[d.xtype || e] is not a constructor网上查了下说 xtype 的值 写错了 可是我是菜鸟
<HTML><HEAD><TITLE>干部管理</TITLE><metahttp-equiv="Content-Type"content="text/html;chars...
<HTML>
<HEAD>
<TITLE>干部管理</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="extjs3.1/resources/css/ext-all.css">
<script type="text/javascript" src="extjs3.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="extjs3.1/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var itemsPerPage = 2;//指定分页大小
var store = Ext.create('Ext.data.Store', {
autoLoad: {start: 0, limit: itemsPerPage},
fields:['id', 'name', 'age'],
pageSize: itemsPerPage, //设置分页大小
proxy: {
type: 'ajax',
url: 'jsonServer.jsp', //请求的服务器地址
reader: {
type: 'json',
root: 'rows',
totalProperty: 'results'
}
}
});
//创建Grid表格组件
Ext.create('Ext.grid.Panel',{
title : '大学生干部管理',
renderTo: Ext.getBody(),
width:800,
height:500,
frame:true,
store: store,
tbar : [{
text:'<center>新建</center>',
handler : function(){
var cell = grid.getSelectionModel().getCurrentPosition();
alert(Ext.JSON.encode(cell));
}
}],
columns: [//配置表格列
{header: "<center>id</center>", width: 40, dataIndex: 'id', sortable: true },
{header: "<center>姓名</center> ",width: 60, dataIndex: 'name', sortable: true},
{header: "<center>年龄</center>", width: 60, dataIndex: 'age', sortable: true},
{header: "<center>性别</center>", width: 60, dataIndex: 'name', sortable: true},
{header: "<center>民族</center>", width: 60, dataIndex: 'name', sortable: true},
{header: "<center>身份证号码</center>", width: 100, dataIndex: 'name', sortable: true},
{header: "<center>政治面貌</center>", width: 60, dataIndex: 'name', sortable: true},
{header: "<center>入党时间</center>", width: 80, dataIndex: 'name', sortable: true}
],
bbar: [{
xtype: 'pagingtoolbar',
store: store, //这里需要指定与表格相同的store
displayInfo: true
}]
});
});
</script>
</HEAD>
<BODY STYLE="margin: 10px"></BODY>
</HTML> 展开
<HEAD>
<TITLE>干部管理</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="extjs3.1/resources/css/ext-all.css">
<script type="text/javascript" src="extjs3.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="extjs3.1/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var itemsPerPage = 2;//指定分页大小
var store = Ext.create('Ext.data.Store', {
autoLoad: {start: 0, limit: itemsPerPage},
fields:['id', 'name', 'age'],
pageSize: itemsPerPage, //设置分页大小
proxy: {
type: 'ajax',
url: 'jsonServer.jsp', //请求的服务器地址
reader: {
type: 'json',
root: 'rows',
totalProperty: 'results'
}
}
});
//创建Grid表格组件
Ext.create('Ext.grid.Panel',{
title : '大学生干部管理',
renderTo: Ext.getBody(),
width:800,
height:500,
frame:true,
store: store,
tbar : [{
text:'<center>新建</center>',
handler : function(){
var cell = grid.getSelectionModel().getCurrentPosition();
alert(Ext.JSON.encode(cell));
}
}],
columns: [//配置表格列
{header: "<center>id</center>", width: 40, dataIndex: 'id', sortable: true },
{header: "<center>姓名</center> ",width: 60, dataIndex: 'name', sortable: true},
{header: "<center>年龄</center>", width: 60, dataIndex: 'age', sortable: true},
{header: "<center>性别</center>", width: 60, dataIndex: 'name', sortable: true},
{header: "<center>民族</center>", width: 60, dataIndex: 'name', sortable: true},
{header: "<center>身份证号码</center>", width: 100, dataIndex: 'name', sortable: true},
{header: "<center>政治面貌</center>", width: 60, dataIndex: 'name', sortable: true},
{header: "<center>入党时间</center>", width: 80, dataIndex: 'name', sortable: true}
],
bbar: [{
xtype: 'pagingtoolbar',
store: store, //这里需要指定与表格相同的store
displayInfo: true
}]
});
});
</script>
</HEAD>
<BODY STYLE="margin: 10px"></BODY>
</HTML> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询