I have some store, which is formed data. On panel, it looks how "fieldName" and text field (in depension from invoked form).
For example, on one form is displayed "name document" and field, on another: date of selling and date field. Data is formed dynamically.
Here is store:
someStore = new Ext.data.JsonStore({
storeId: 'myStore',
url: objectUrlAddress,
baseParams: {
'objectID': objectID
},
root: 'Fields',
fields: [{
name: 'Hint'
}, {
name: 'Type',
type: 'int'
}, {
name: 'Value'
}, {
name: 'Index',
type: 'int'
}, {
name: 'IsRequired',
type: 'bool'
}, {
name: 'Identifier'
}, {
name: 'EnumList'
}, {
name: 'Directory'
}, {
name: 'Data'
}]
});
Here's grid
var templateGrids = new Ext.grid.EditorGridPanel({
id: 'tableId',
height: 300,
width: '100%',
clicksToEdit: 1,
frame: true,
store: tableTempStore,
columns: [{
header: 'Поле',
id: 'name',
width: 200
}, {
header: 'Значения',
id: 'val',
dataIndex: 'Value',
width: 300,
editor: colm,
edit: function(colm, record) {
if (record.get('Type') == 2) {
return colm = {
xtype: 'textfield'
};
} else if (record.get('Type') == 3) {
return colm = {
xtype: 'datefield'
};
} else if (record.get('Type') == 4) {
return colm = {
xtype: 'combo'
};
}
}
}]
});
Type of cell may be displayed in a grid in dependence from value of 'Type'.
For example if Type == 2
, editor of column must be textvalue
and etc. But my listener is not working and type is not changing.
Please help me to understand what wrong am I doing?
This is definitely an interesting problem statement to solve with ExtJS!!
I did managed to get solved with some modifications to the ExtJS 6.6.0 Editable Plugin api.
Here is working poc code for same:
Link to working fiddle with ExtJS 6.6.0: https://fiddle.sencha.com/#view/editor&fiddle/2nig