日期:2014-05-16 浏览次数:20626 次
var store=Ext.create('Ext.data.Store',{
model:'Users',
proxy:{
type:'ajax',
url:'App_Ashx/Demo/Grid.ashx',
reader:{
//type:'json',
totalProperty:'totalCount',
root:'data'
}
}
});
alert(store.getCount());
public void ProcessRequest(HttpContext context)
{
context.Response.Clear();
context.Response.ContentType = "text/plain";
//context.Response.ContentType = "json/application";
context.Response.Write("{\"totalCount\":2,\"success\":true,\"data\":[{\"Name\":\"wys\",\"Gender\":\"mail\"},{\"Name\":\"wys1\",\"Gender\":\"mail\"}]}");
}
var store=Ext.create('Ext.data.Store',{
model:'Users',
proxy:{
type:'ajax',
url:'App_Ashx/Demo/Grid.ashx',
////////////////////////
listeners:{load:function(store,records,success,opts){alert(store.getCount())}},
reader:{
//type:'json',
totalProperty:'totalCount',
root:'data'
}
}
});
alert(store.getCount());