Hi there
I am using a CheckColumn (plugin) in an EditorGridPanel. It updates fine with the info from my database (i.e. it shows checked/unchecked depending on the values 1 or 0 in the database). The problem comes when I check or uncheck the checkbox - the change doesn't get updated in the database. Changes to the other fields work just fine, it is just the checkbox that I can't seem to make work.
I have a feeling I have to use a different listener than afteredit (checkchange probably), but I can't figure out how.
I hope someone can help me.
Here's a some of my code, hopefully someone can help me - I am very green when it comes to Ext JS.
Code:
var checkColumn = new Ext.grid.CheckColumn({
header: 'State funded',
dataIndex: 'is_state_funded',
width: 100,
});
var grid = new Ext.grid.EditorGridPanel({
.. code left out ...
columns: [
{header: "ID", dataIndex: 'id', id: 'id', width: 35},
{header: "School Name", dataIndex: 'school_name', id: 'school_name', editor: school_name_edit, width: 220},
{header: "School Type", dataIndex: 'school_type', renderer: school_type_name, editor: school_type_edit, width:100},
checkColumn
],
}),
sm: new Ext.grid.RowSelectionModel({
singleSelect: true
}),
listeners: {
afteredit: function(e){
Ext.Ajax.request({
url: 'schools-update.php',
params: {
action: 'update',
id: e.record.id,
field: e.field,
value: e.value
},
success: function(resp,opt) {
e.record.commit();
},
failure: function(resp,opt) {
e.record.reject();
}
});
}
},
... code left out ...