View Full Version : setting IdProperty on models

19 Jan 2012, 9:05 PM
Hi, im trying to set the id property in a model, to the my own table id, in documentation says this can be done setting the idProperty in a model. so i did the following code, but still is sending the default id field (which is "id")

(im using ext-4.1.0-beta-1)

Ext.onReady(function() {

Ext.define('User', {
extend: 'Ext.data.Model',
fields: [
{name:'usrId' ,type:'int'},
{name:'usrLogin' ,type:'string'},
idProperty: 'usrId',
{ type: 'direct',
api:{read : usrDefaultQuery.usrSelect}


The request in console says : the post data (data sent) is


the id: 3 shouldnt be usrId : 3 ?
i know i can do User.load({params:{ usrId : 3} }) but i think is not the way , theres a reason for idProperty exists, also this load will send 2 paremeters, id and usrId.

(sorry for my english).

20 Jan 2012, 7:38 AM
anyone ?