Hi, I have a column of checkboxes (checkcolumn) and I want that, when the user selects one of the checkbox (one row), all of the others become unavailable for selection
Is there an example that shows how can I achieve that?
What are you trying to do that you feel requires this behavior? I suspect there's a different way to go about doing this, e.g., we have selection grids whose tool buttons enable and disable depending on what/how many rows are selected. Additionally, one could argue that doing what you suggest is not typical UI behavior that your users might expect and would thus result in a poor UX.
From what I can see, there is no way to access the checkboxes in CheckBoxSelectionModel without doing something that is probably more work than you'll want to do.
Depending on your answer to my question, let's see if we can help you out.
What I want to do is quite simple, its a grid with where the first column is a check box. User can select one and ony one row. After he checked the first row, I would like the rest of the check boxes to be unavailable for selection. If he unchecks the checked checkbox, all of them are available again
Sorry, I wasn't clear.
I understand the behavior you want. What I'm trying to understand is what the actual functional behavior is that you are trying to accomplish by allowing only one checkbox to be selected at a time and taking the additional step to disable the others. That is to say, why do you feel you need this behavior?
E.g., let's say I have a clone button in a tool bar for my grid and that the the clone functionality only makes sense when operating on one row at a time. Good UX would dictate that the clone button is enabled only when one checkbox is selected and disabled at all other times. Doing this would obviate the need to disable the other checkboxes.
The CheckboxSelectionModel does not give direct (and perhaps even indirect) access to the underlying checkboxes. There may be a way to access them by extending either it or its underlying appearance class but I would encourage you to take a look at why you think you need this behavior you're seeking and perhaps consider a different way.
Tags for this Thread