我的js代码如下:
/**
* @author fox
*/
Ext.onReady(function(){
//Ext.BLANK_IMAGE_URL = 'extjs/resources/images/default/s.gif';
//Ext.QuickTips.init();
var sm = new Ext.grid.CheckboxSelectionModel();
var cm = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),
sm,
{header:'姓名',dataIndex:'stuName',sortable:true},
{header:'学号',dataIndex:'stuNum',sortable:true},
{header:'性别',dataIndex:'stuSex',renderer:function(value){
if(value=='男'){
return "<span style='color:red;font-weight:bold;'>男</span>";
}else{
return "<span style='color:green;font-weight:bold;'>女</span>";
}
}}, //增加性别
{header:'年龄',dataIndex:'stuAge'},
{header:'电子信箱',dataIndex:'email'}
]);
var store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'http://localhost:8000/Student/JsonPlugin.action'}),
reader: new Ext.data.JsonReader({root: 'root'},
[
'stuName','stuNum','stuSex','stuAge','email',
{name: 'stuName',mapping:'stuName',type:'string'},
{name: 'stuNum',mapping:'stuNum',type:'string'},
{name: 'stuSex',mapping:'stuSex',type:'string'},
{name: 'stuAge',mapping:'stuAge',type:'int'},
{name: 'email',mapping:'email',type:'string'}
])
});
var grid = new Ext.grid.GridPanel({
store: store,
sm: sm,
cm: cm,
width:700,
height:280
});
//el:指定html元素用于显示grid
grid.render('grid');
});我在页面可以显示当前这样的Grid,标题什么都可以显示,就是没有数据显示出来,在红色链接区域http://localhost:8000/Student/JsonPlugin.action 单独测试是完全可以返回JSON数据的,在Ext一结合就不能运行该请求,用debug测试无法进去该方法,请各位帮我解决下,谢谢啦,我也是刚接触,急用.
/**
* @author fox
*/
Ext.onReady(function(){
//Ext.BLANK_IMAGE_URL = 'extjs/resources/images/default/s.gif';
//Ext.QuickTips.init();
var sm = new Ext.grid.CheckboxSelectionModel();
var cm = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),
sm,
{header:'姓名',dataIndex:'stuName',sortable:true},
{header:'学号',dataIndex:'stuNum',sortable:true},
{header:'性别',dataIndex:'stuSex',renderer:function(value){
if(value=='男'){
return "<span style='color:red;font-weight:bold;'>男</span>";
}else{
return "<span style='color:green;font-weight:bold;'>女</span>";
}
}}, //增加性别
{header:'年龄',dataIndex:'stuAge'},
{header:'电子信箱',dataIndex:'email'}
]);
var store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'http://localhost:8000/Student/JsonPlugin.action'}),
reader: new Ext.data.JsonReader({root: 'root'},
[
'stuName','stuNum','stuSex','stuAge','email',
{name: 'stuName',mapping:'stuName',type:'string'},
{name: 'stuNum',mapping:'stuNum',type:'string'},
{name: 'stuSex',mapping:'stuSex',type:'string'},
{name: 'stuAge',mapping:'stuAge',type:'int'},
{name: 'email',mapping:'email',type:'string'}
])
});
var grid = new Ext.grid.GridPanel({
store: store,
sm: sm,
cm: cm,
width:700,
height:280
});
//el:指定html元素用于显示grid
grid.render('grid');
});我在页面可以显示当前这样的Grid,标题什么都可以显示,就是没有数据显示出来,在红色链接区域http://localhost:8000/Student/JsonPlugin.action 单独测试是完全可以返回JSON数据的,在Ext一结合就不能运行该请求,用debug测试无法进去该方法,请各位帮我解决下,谢谢啦,我也是刚接触,急用.
解决方案 »
- struts1安装的时候重启tomcat时候出错
- org.dom4j.DocumentException: Read timed out Nested exception: Read timed out
- 求面试题
- 请用最简单的话概括hibernate的优缺点!急急急
- spring配置问题
- ireport javabean做数据源问题 请高手赐教!
- 在dao层里想获取表单上的元素值,有办法吗?
- spring 连接数据库出错,疯了
- struts1.1中validation.xml和validator-rules.xml对应的关系?
- 有关JBUILDER 调试,请指点
- spring+hibernate配置的事务不回滚
- 谁能给我java的站内信源码?
autoLoad:true
或
触发Store.load()