Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by David on Dec 08, 2008 02:21
open dhtmlx forum
Grid with dynamic subgrid, expandable - not expandable

I have a question if it is possible in any way to achieve a grid where not every row has a subgrid.

I'm using the grid to dynamically bind data -> myGrid.parse(arr,"jsarray");
The grid has a sub_row_grid excell and I attached the onSubGridCreated event to create the subgrid for each entry.

In the attached event I do the databinding for the subgrid using parse -> subGrid.parse(arr,"jsarray");

As a matter of fact, there can be rows which have no entry in the created subgrid. In this case, the parent entry of the main grid will still show the "+" and enable the user to expand the grid and show the empty subgrid.

I want to hide the "+" and/or even avoid the creation of a subgrid when there are no entries to show.

Hopefully this is known matter, unfortunately I was not able to find anything related to this.
Thanks in advance,

David.
Answer posted by Support on Dec 08, 2008 02:35
>>I want to hide the "+" and/or even avoid the creation of a subgrid when there are no entries to show.
Just set initial value of sub_grid_excell cell empty (empty value of related element inside arr, used for myGrid.parse) , if value is empty - there will not be "+" sign to open the cell

Answer posted by David on Dec 08, 2008 06:38

Thanks.

Well I should've resolved this myself since it's quite self explanatory :)

Only the tooltip "expand/collapse"  remains in the cell where the "+" is no longer shown...

Answer posted by Support on Dec 08, 2008 08:31
Problem with incorrect tooltip confirmed and fixed. 
Fixed js file sent by email.