Hi there,
Actually I want to resize the column width automatically when I add the column dynamically.
:: Means suppose I am setting widths thru setInitWidthsP and I add the column dynamically thru some click, then I want added column to adjust its width automatically. Example : 4 columns each with 25% width and suppose I add fifth column then automatically all rows width % shud be 20.
:: Also I have set the column color thru grid.setColumnColor("#F7EBBA,white,white,white");
So how to give same style to the newly added column >???
How to do this ?
I add fifth column then automatically all rows width % shud be 20.
You need to set initial width as
mygrid.setInitWidths(",,,")
and use * as size for newly added column, in such case all columns take equal size to fill all available space.
>>So how to give same style to the newly added column >???
9th parameter of insertColumn command - columnColor
Hi,
Can I give color to the header also while adding column using insertColumn() ???
Insert column doesn’t allow to set such parameter.
You can access and set color directly to DOM element after column adding as
grid.hdr.rows[1].cells[index].style.backgroundColor=“color”;
Hi,
I used following to change the color of the column (added through script)
.hdr.rows[1].cells[index].style.backgroundColor=“color”; but after adding some say 5-6 columns, it stops changing the color of the header. Why it happens ?
It must work correctly for any count of columns
If you are using colspans or rowspans in grid’s header - beware that index is “actual” not “nominal” column index.
( if you have 1st and 2nd columns combined in colspan, the index of 3rd column will be 1 )