[color=#FF0000][size=14px]由于第一次使用这个,了解的还不深,请大家说详细点,谢谢 下面是js代码 就以个Grid[/size][/color]
Ext.onReady( function() {
//表格组件
var sm = new Ext.grid.CheckboxSelectionModel();
var cm = new Ext.grid.ColumnModel( [ new Ext.grid.RowNumberer(),
sm, {
header :'编号',
dataIndex :'id',
width :100
}, {
header :'姓名',
dataIndex :'names',
width :100
}
   ]);
cm.defaultSortable = true; // 表格数据
var store = new Ext.data.Store( {
proxy :new Ext.data.HttpProxy( {
url :'tjson.action',
method :'POST'
}),
reader :new Ext.data.JsonReader( {
}, [ {
name :'id',
mapping :'id'
}, {
name :'names',
mapping :'names'
} ]), 
sortInfo : {
field :'names',
direction :'DESC'
}
});
store.load(); //表格组装
var grid = new Ext.grid.EditorGridPanel( {
el :'grid-example',
store :store,
cm :cm,
sm :sm,
autoHeight :true,//自动调整高度
autoWidth :true,//自动调整宽度
//height :350,
title :'人员信息表格' // 表格的标题
});
grid.render();
});
下面是Action里的 public String jsonArrery(){ try {
List gridList  = getService().jsonTest();
int total = gridList.size();
System.out.println(total);
JSONArray array = JSONArray.fromObject(gridList);//运行到这错误
jsonString = "{count:" + total + ",grids:" + array.toString() + "}";
// 输出JSON串
JsonAction.outJson(jsonString);

} catch (Exception e) {  
// TODO Auto-generated catch block
e.printStackTrace();

return "jsons";
}  
jsonTest();里的代码
public List jsonTest() throws Exception {
// TODO Auto-generated method stub
Session session = services.CreateSession();
Query query = session.createSQLQuery("select * from text");
List list = query.list();
return list;
}
运行到注释那个地方错误了!现在请大家帮我下 怎么才能读出来数据,第一次啊,很激动,越激动越出不来,先谢谢了