PDA

View Full Version : set IdProperty in model store



infosvil
10 Feb 2020, 7:46 AM
Good morning,
I can't set idProperty in store model.
Here my code:


let myid = 'mioid';
let model = Ext.create('Ext.data.Model', {
fields: myfields,
idProperty: myid
});
let store = Ext.create('Ext.data.Store', {
model: model
});

trying to do model.getIdProperty() I receive "id" as result.

infosvil
12 Feb 2020, 10:09 AM
No model instance can be passed in store.
Best solution I found:

let store = Ext.create('STORENAME', {
model: Ext.define(null, {
extend: 'app.GridModel',
idProperty: 'customID'
})
});