weixin_42494179 2011-11-28 16:00
浏览 198
已采纳

ASP如何接收ExtJS4前台Gird 的數據?

Ext.define('Winfo.store.Sites', {
extend : 'Ext.data.Store',
requires : ['Winfo.model.Site'],
model : 'Winfo.model.Site',
autoLoad:true,
remoteSort : true,
pageSize : 25,
//autoSync : true,
proxy : {
type : 'ajax',
api : {
read : siteService.asp?act=read',
update : siteService.asp?act=update'
},
reader: {
type: 'json',
root : 'records',
successProperty: 'success'
},
writer: {
type: 'json',
writeAllFields: true,
encode: false,
root : 'records'
}
},

initComponent : function() {
var me=this;
me.callParent(arguments);
}
});

請問各為ExtJS前輩..
小弟目前正学习使用ASP + ExtJS4 这期间碰到了一些问题...
找了许久都没找到答案,希望大大沉余之时拨空能够给小弟一些方向或是参考的范例文件

我在store(如上)我使用了Proxy type:ajax 可以使前台的Grid 透透 Store 的Proxy API:read 成功的与后台(ASP)取得资料
但当我编辑Grid(Ext.grid.plugin.CellEditing)时,
用Firebug 查看只有_dc xxxxxxxxxxxx 的参数,
但有一个post {"records":[{"cell_fa_index":"1","id":"100001_2"}]}

而我使用下列程式码测试取得传过来的参数

FOR each item in Request.Form
response.write Item
Next
只有_dc 这参数

但无法取得 {"records":[{"cell_fa_index":"1","id":"100001_2"}]}
请问要如何在后台(ASP),接收前台传过来的资料呢??

感谢大大....

  • 写回答

1条回答 默认 最新

  • gyemen 2011-11-28 16:57
    关注

    你想问的是store怎么把参数传到后台么?store有个getProxy方法,[code="java"]getProxy( ) : Ext.data.proxy.Proxy

    Returns the proxy currently attached to this proxy instance
    Returns

    Ext.data.proxy.Proxy
    
    The Proxy instance
    

    [/code]得到这个store的proxy对象,然后调用extraParams方法可以动态设置参数。
    [code="java"]extraParams : Object

    Extra parameters that will be included on every request. Individual requests with params of the same name will override these params when they are in conflict.
    [/code]
    这样用
    [code="java"]
    store.getProxy().extraParams={
    siteid: site_no,//这里面是你想要传的参数,:号前面是对应request中的参数名
    sitename: site_name,//字,我不知道asp在后台是怎么从request中取得参数的
    cellid: cellid,//:号后面是你再页面上定义的变量,也就是想传回去的参数值
    cellname: cellname
    };
    getXqStore.load();
    [/code]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 易语言把MYSQL数据库中的数据添加至组合框
  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况