Extjs change default value for repository

Suppose there is a JsonStore:

SomeStore = Ext.extend(Ext.data.JsonStore, {
  constructor: function(cfg) {
    cfg = cfg || {};
    OrdersStore.superclass.constructor.call(this, Ext.apply({
      storeId: 'someStore',
      url: 'someUrl',
      root: 'rows',
      fields: [
        {
          name: 'someId'
          defaultvalue : '100'
        }
      ]
    }, cfg));
  }
});

How to do it:

new SomeStore().getFieldByname('someId').setDefaultvalue = '73'

What is the correct syntax for this?

+3
source share
1 answer

someStore.fields.item ('someId'). defaultValue = 73;

+3
source

All Articles