extjs 4.2 POST数据id = 0不允许生成方法-Laravel 4

克里斯

当我向laravel 4服务器发送数据(存储在codeblock中)时,出现“不允许的方法”,并且服务器返回除POST之外所有允许的方法。当我在模型中注释掉“ id”时,一切正常。(不想注释掉id)

我在我的writer属性中尝试了writeRecordId:false和writeAllFields:false,但这并没有在发送时删除ID。

Ext.define('Equipment.store.Equipments', {
extend: 'Ext.data.Store',
model: 'Equipment.model.Equipment',
requires: ['Ext.data.proxy.Rest'],
alias: 'store.Equipments',
proxy: {
    type: 'rest',
    url: '/json/stock/equipment',
    reader: {
        type: 'json',
        root: 'data',
        successProperty: 'success'
    },
    writer: {
        type: 'json'
    }
},
groupField: 'location'

});

数据发送:

{"id":0, "location":"Building123","locationDetails":"office 2","locationIndex":"drawre 5", "description":"item 7"}
克里斯

我想我已经解决了它,我认为:

Ext.define('Equipment.model.Equipment', {
extend: 'Ext.data.Model',

fields: [

    {   name: 'id',
        type: 'number',
        useNull: true
    },

将“ useNull:true”沿id设置{“ id”:null,...在服务器接受的数据中。有人愿意发表评论吗?

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章