日期:2014-05-16 浏览次数:20907 次
Ext.onReady(function(){
Ext.QuickTips.init();
// 创建一个grid面板
var myGrid = Ext.create('Ext.grid.Panel',{
title:'我的grid面板',
//store:Ext.data.StoreManager.lookup('s_user'),
columns:[
{text:'姓名',dataIndex:'name'},
{text:'年龄',dataIndex:'age'},
{text:'邮件',dataIndex:'email'}
],
renderTo:'gridDemo',
store:{
fields:[
{name:'name',type:'string',sortable:true},
{name:'age',type:'int',sortable:true},
{name:'email',type:'string',sortable:true}
],
proxy : {
type : 'ajax',
url : '/ext/gridDemo.action',
reader : {
type : 'json',
root : 'root'
}
},
autoLoad : true
}
});
});
Ext.create('Ext.data.Store',{
storeId:'s_user',
//model:'User',
fields:[
{name:'name',type:'string',sortable:true},
{name:'age',type:'int',sortable:true},
{name:'email',type:'string',sortable:true}
],
proxy:{
type:'ajax',
url:'/ext/gridDemo.action',
reader:{
type:'json',
root:'root'
},
autoLoad:true
}
});
// 创建一个grid面板
var myGrid = Ext.create('Ext.grid.Panel',{
title:'我的grid面板',
store:Ext.data.StoreManager.lookup('s_user'),
columns:[
{text:'姓名',dataIndex:'name'},
{text:'年龄',dataIndex:'age'},
{text:'邮件',dataIndex:'email'}
],
renderTo:'gridDemo'
});