Вопрос

I want to implement a dynamic column in grid panel, how can I do it? I used Extjs 4.0.7:

var result = Ext.JSON.decode(response.responseText);
store.model.setFields(result.fields);
grid.reconfigure(store, result.columns);
store.loadRawData(result.data, false);

The method setFields() doesn't exist in version 4.0.7

Это было полезно?

Решение

Try something like :

var store = new Ext.data.Store({fields: result.fields, data: result.data})

grid.reconfigure(store, result.columns})

The fields config on Store has always behaved this way, with the ability to pass in fields instead of a model. http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.AbstractStore-cfg-fields

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top