日期:2014-05-16 浏览次数:20969 次
Ext.onReady(function () {
var store = new Ext.data.Store({
fields: [{ name: 'user_id' }, { name: 'user_name' }, { name: 'ssyj', type: "float"}],
reader: new Ext.data.JsonReader({ totalProperty: "results", root: 'data' })
// listeners: {
// load: function () {
// alert(store.getCount());
// }
// }
});
var requestConfig = {
url: '/WebService/test/tb_data.ashx', //请求的服务器地址
params: { userName: 'tom', password: '123' }, //请求参数
customer: '自定义属性', //附加属性
callback: function (options, success, response) {//回调函数
alert(response.responseText);
var forminfo = Ext.decode(response.responseText);
store.loadData(Ext.JSON.decode(response.responseText,true));
alert(store.getCount());
}
}
Ext.Ajax.request(requestConfig); //发送请求
public void ProcessRequest(HttpContext context)
{
context.Request.ContentEncoding = Encoding.GetEncoding("UTF-8");