Is there any way to disable “idProperty” of Model in Extjs?

后端 未结 3 1266
渐次进展
渐次进展 2021-01-23 16:53

I have a simple Model/proxy. When I create a object of model to send to server via REST, ExtJs is generating Id and putting its value in my \"id\" field and that is conflicting

3条回答
  •  生来不讨喜
    2021-01-23 17:47

    Set config options: persist: false.

    Ext.define('User', {
        extend: 'Ext.data.Model',
        idProperty : 'login'
        fields: [
            {name: 'login', type: 'string', persist: false},
            {name: 'username', type: 'string'},
            {name: 'password', type: 'string'}
        ]
    });
    

提交回复
热议问题