View Full Version : How to disable a cell in a Grid

6 Oct 2011, 12:51 AM
Hey all

I have a little question about the grid and the cells in the grid. How can I disable a single cell in the Grid?

6 Oct 2011, 12:52 AM
What does disable mean for you? What are you trying to do?

6 Oct 2011, 12:58 AM
I will disable a single cell. disable meens that the user is not able to edit this cell. I have a grid with checkboxes and in the first row i like to disable the first cell in the second row the second cell and so on. how can i do that?

6 Oct 2011, 1:01 AM
So you do not want to allow editing?

You can listen to the BeforeEdit event of the EditorGrid and cancel the event if you do not want to allow editing.

6 Oct 2011, 1:06 AM
The problem is that I have checkboxes in my Grid. I don't need an editor to edit a column. therefor i can not use the befor edit methods.

Is there an other possiblity?

6 Oct 2011, 1:08 AM
What kind of checkboxes? We require more informations from you to actually help you. Best would be you would post a simple, standalone testcase implementing EntryPoint of your grid and explain exactly which behaviour you are looking for. Disabling a cell can mean anything.

6 Oct 2011, 1:12 AM
As an example you can see at the showcase for gxt.

My Grid is like that. The only difference is that I have obly these kind of checkboxes.

And know my question how can I disable the checkbox in the second row and in the fourth row?

I hope I could explain it. In German is it easier :D

6 Oct 2011, 1:14 AM
So you are using a checkcolumnconfig. Take a look at the onMouseDown method and do not call the logic if it matches your case.

6 Oct 2011, 2:24 AM
Ok it works. Thanks a lot.

8 Oct 2011, 12:27 AM
Maybe this will be useful for you also