I have plenty of fields that I want to add to my model. I fount this thread Dynamic Model with ExtJS 4 but in 5th version there is no method setFields for the model.
Asked
Active
Viewed 3,065 times
3 Answers
4
Thanks for everybody, I used method addFields() and made it in this way:
var model = Ext.ClassManager.get('app.model.GridModel');
var fields = [];
fields.push({ name: 'param', type: 'string' });
for (var i=1; i<20; i++){
fields.push({ name: 'name', type: 'string'});
}
model.addFields(fields);

antosiy
- 131
- 1
- 11
0
There is a replaceFields
method, though.
Note that this won't magically create the field data any existing models, though.

Robert Watkins
- 2,196
- 15
- 17