-
22 Nov 2011 6:15 AM #1
TreeGrid and CellEditor
TreeGrid and CellEditor
Hi,
I have a TreeGrid and have added CellEditors to two columns. Both columns are not the tree column (a date and a comment). The tree should not support editing on every row, so how I can prevent the rendering of the editor on some rows? the CellEditor only holds a column/row number, how I can get the ModelData instance to check the possibility of editing in this row?
Thanks
André
-
22 Nov 2011 6:21 AM #2
You could listen to the BeforeEdit event and cancel that if that specific cell should not be edited.
-
22 Nov 2011 8:12 AM #3
I have found it:
The "tree" should also an instance of EditorTreeGrid. Don't forget to set the clicksToEdit:Code:tree.addListener(Events.BeforeEdit, new BeforeEditListener()); private class BeforeEditListener implements Listener<GridEvent<ModelData>> { public void handleEvent(GridEvent<ModelData> event) { ModelData model = event.getModel(); // check, if the model is on the right place to edit // use the store } }
~AndréCode:tree.setClicksToEdit(ClicksToEdit.TWO);


Reply With Quote