Hybrid View
-
26 Jul 2010 5:41 AM #1
OnChange / AfterEdit event for EditorGrid with checkbox column
OnChange / AfterEdit event for EditorGrid with checkbox column
Hello.
I have a EditorGrid with a Checkbox column:
Now, I'd like to be notified when a row was edited.Code:CellEditor checkBoxEditor = new CellEditor(new CheckBox()); [...] gridEmployees = new EditorGrid<ModelData>(new ListStore<ModelData>(), new ColumnModel(configs_3));
But the event isn't coming when I check the checkbox. When I use a SimpleComboBox instead of the CheckBox, the event is coming when I change the selection. But I need the checkbox...Code:gridEmployees.addListener(Events.AfterEdit, changeListener);
Thanks for your help,
Jonas.
-
26 Jul 2010 5:43 AM #2
Please post more code about "configs_3"
-
26 Jul 2010 5:53 AM #3
Code:List<ColumnConfig> configs_3 = new ArrayList<ColumnConfig>(); ColumnConfig lastName = new ColumnConfig("lastName", CONSTANTS.nlsLastName(), 120); configs_3.add(lastName); ColumnConfig givenName = new ColumnConfig("givenName", CONSTANTS.nlsFirstName(), 120); configs_3.add(givenName); CheckColumnConfig checkSupervisor = new CheckColumnConfig("isSupervisor", CONSTANTS.nlsDepartmentManager(), 100); CellEditor checkBoxEditor = new CellEditor(new CheckBox()); checkSupervisor.setEditor(checkBoxEditor); configs_3.add(checkSupervisor); gridEmployees = new EditorGrid<ModelData>(new ListStore<ModelData>(), new ColumnModel(configs_3)); gridEmployees.setAutoWidth(true); gridEmployees.setAutoHeight(true); gridEmployees.setBorders(true); gridEmployees.addPlugin(checkSupervisor);
-
26 Jul 2010 5:54 AM #4
When using a CheckColumnConfig you are not using any functionality of the editorgrid. Also you dont need to to set any celleditor than. Change it to a normal ColumnConfig and it will work.
-
26 Jul 2010 6:17 AM #5
Ok thanks,
but then the grid looks ugly because in the cell is the text "true" or "false" and the checkbox will only appear when I click on a cell.
-
26 Jul 2010 6:23 AM #6
So add a CellClick listener to the grid. and check for the columnindex. You can use a normal grid in this case together with the checkcolumnconfig.
Similar Threads
-
EditorGrid, changing column afterEdit
By olriche38 in forum Ext 3.x: Help & DiscussionReplies: 7Last Post: 25 Feb 2010, 3:47 AM -
Event AFTEREDIT is not triggered when CheckBox is checked
By msuresh in forum Ext 2.x: Help & DiscussionReplies: 25Last Post: 26 Jul 2009, 1:28 AM -
why 'afteredit' event can't fire in my editorgrid
By qqeerr20012001 in forum Ext 1.x: Help & DiscussionReplies: 8Last Post: 23 Jul 2007, 1:51 AM -
afteredit event in an editorgrid sent twice!!
By lucas in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 9 Mar 2007, 12:59 AM


Reply With Quote