日期:2014-05-16 浏览次数:20379 次
Ext.onReady(function(){
//request data by Ext.Ajax.request from Server
Ext.Ajax.request({
url:'App_Ashx/Demo/Grid.ashx',
callback: function (options, success, response) {
var data=response.responseText;
//alert(data);
var jsonData=Ext.decode(data);
Ext.define('Users',{
extend:'Ext.data.Model',
fields:jsonData.fields
});
var store=Ext.create('Ext.data.JsonStore',{
model:'Users',
data:jsonData.data,
fields:jsonData.fields
});
var grid=Ext.create('Ext.grid.Panel',{
renderTo:'example-grid1',
width:600,
height:400,
store:store,
columns:jsonData.HeaderText
});
}
});