I want to dynamically insert columns to the grid and each column that I add have two standard sub headers. I am able to add a column dynamically but I don’t know how to add the sub header using the grid.attachHeader(…) to the column added.
The piece of code below shows only one sub-header under each column, but I want to show two sub-header under each column that i have added,
The columns added to the grid will have the same count of rows in header as existing grid has. So you need to have the header with two additional lines in header ( which can be combined by rowspans ) - in such case newly added column will have necessary column count.
I don’t want two sub-header columns (text 2, text 3) one below the other which is below the main header column(text 1). What I need is ‘text 1’ column divided into ‘text 2’ and ‘text 3’. And this main header column like ‘text 1’ should be dynamically inserted into the grid and can be inserted ‘n’ number of times.
To achieve such effect you will need to create a colspan in top header row, but in not possible to include column in top level colspan by insertColumn operation. The only way to achieve such usecase - create grid with necessary configuration by grid.setHeader(…)