Grid sub-grid checkbox three-state

Hey everybody,

I have a problem with my grid.
I created a grid with a checkbox in second column and a sub-grid in first column.
My sub-grids also have a checkbox (in first column).
I have scripted a logic that every rows checkbox in sub-grid gets the same state as parent row of my grid (grid -> row = (un)checked => sub-grid -> rows = (un)checked).
My problem is that I’d like to have the grid - row “partially” checked if in the sub-grid only a few rows are checked.

I found out that a tree has this function implemented but is such a logic implemented for a grid (with sub-grid(s))? Or does someone implemented such a logic himself?

If so maybe you can help me out? :unamused:

Thank you so far :wink:

Ok, my logic now works fine, the only problem now is how to set a custom image for the checkbox when required? For the moment I only can set a value 0 (unchecked) or any greater 0 (checked).
Anay idea? ^^

Unfortunately three-state checkboxes are not supported in dhtmlxgrid.
You may try to create your own custom exCell type.
Here is the tutorial with some examples:
docs.dhtmlx.com/doku.php?id=dhtm … l_creation

Okay, I thought that.
I already tried to write it my own but it’s more complicated than it looks and I guess for my usecase it is a bit oversized…

Is it the only chance I have or is it possible only to set the image of a checkbox column?

The only way is to replace default images of checkboxes with yours.

Yes, right, but the problem is, that a “normal” checkbox still has two states - checked and unchecked.
It doesn’t matter which value is set for the checkbox - zero is unchecked, every other value means checked. There is no way to set an image as value to display, it is a value unequal zero and so the checkbox has the state checked…

I really think the only way would be to implement an own eXcell - maybe I find some time to try that :slight_smile:
For the moment I only changed the background color of the cell to display the third state ^^