首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jsonObject在商店autoLoad

jsonObject在商店autoLoad
EN

Stack Overflow用户
提问于 2013-07-16 10:34:05
回答 1查看 187关注 0票数 1

我有一个带有分页工具栏和WCF后端的网格。网格后面的商店配置如下

代码语言:javascript
复制
Ext.define('WonderCarDevi.store.Quotations', {
extend: 'Ext.data.Store',
model: 'WonderCarDevi.model.Quotation',
id: 'Quotations',
proxy: {
    timeout : 60000,
    type : 'ajax',
    url: '/blaservice/GetOffers',
    actionMethods:{create: 'GET', read: 'POST', update: 'POST', destroy: 'POST'},
    pageSize:50,
    reader: {
        root: 'GetOffersResult',
        totalProperty: 'total'
    },

    headers: {
        'Content-Type': 'application/json; charset=utf-8'
    }
},
autoLoad: {params:{start: 0, limit: 25}}
//    autoLoad: {jsonData:{start: 0, limit: 25}}

此请求的有效载荷是:

代码语言:javascript
复制
start=0&limit=25

这样做不起作用,而且服务也没有给我发送正确的数据,但是当我这样做的时候:

代码语言:javascript
复制
Ext.Ajax.request({
        url:'/WonderCarService/WonderCarService.svc/GetOffers',
        method:'POST',
        jsonData:{start:0,limit:25},
        success:function (resp, opts) {
            var responseObj = Ext.decode(resp.responseText);
            console.log(responseObj);
        },
        failure:function (resp, opts) {
        },
        scope:this
    });

请求有效载荷是:

代码语言:javascript
复制
{"start":0,"limit":25}

它确实有效..。

如何使将json对象发送到服务

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-07-18 09:01:51

这件事在Sencha论坛上被Skirtle解决了。

在他的博客中,他解释了如何使用自定义代理将参数形成为jsonData ..。而且它工作得很完美

http://skirtlesden.com/articles/custom-proxies

(如果你太懒,可以搜索jsonData ;)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17674265

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档