Is there any way to merge 4 cells (2rows x 2columns) together?
Suppose we have the following header:
grid.setHeader(“1-1,1-2,1-3,1-4”);
grid.attachHeader(“2-1,2-2,2-3,2-4”);
grid.attachHeader(“3-1,3-2,3-3,3-4”);
grid.attachHeader(“4-1,4-2,4-3,4-4”);
The question is how to merge cells 2-2,2-3,3-2,3-3 together.
I found some kind of solution, but not sure if it is proper one because this solution has a trick to balance cells quantity in the third row. I wonder if it may cause any error somewhere later in grid methods.
Here is the way I implement the task:
grid.setHeader(“1-1,1-2,1-3,1-4”);
grid.attachHeader(“2-1,2-2,#span,2-4”);
grid.attachHeader(“3-1,#rspan,3-4”);//here only 3 cells
grid.attachHeader(“4-1,4-2,4-3,4-4”);
May be it could be done other way without tricks. I’ll appreciate any comments
If I put #rspan two times in the third header row then all cells go crazy:?
I think the problem is that both #cpan and #rspan is applied for one cell at the same time. I’ve seen somewhere in this forum that it’s not allowed for the grid.
Only for the following creates table cells properly for me:
grid.attachHeader(“2-1,2-2,#span,2-4”);
grid.attachHeader(“3-1,#rspan,3-4”);//here only 3 cells instead of 4
The above overcomes only html generation and only for header rows except the first one. It doesn’t seem to be a clear solution. I don’t think also that the rest functionality will work properly in this way.
I doubt that advanced merging is supported in the current version of the grid component, only simple merging.
I found smarter solution - change header to avoid this kind of advanced merging