PDA

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



Ceene
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?

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

Ceene
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?

sven
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.

Ceene
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?

sven
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.

Ceene
6 Oct 2011, 1:12 AM
As an example you can see at the showcase for gxt.
http://extjs.com/examples/#roweditorgrid

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

sven
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.

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

vtysh
8 Oct 2011, 12:27 AM
Maybe this will be useful for you also
http://www.sencha.com/forum/showthread.php?147590-Disable-row-in-grid&p=650214&viewfull=1#post650214