Adds a column or columns to the grid.
addColumn([before], column)
before |
string or integer, optional, column to insert before |
column |
object or array, column(s) to add |
Returns integer.
Description
Adds a column or columns to the grid by adding items into .columns array
and refreshes the grid. The first optional argument before is the column to insert before. It
can be either a column field name or the index in the .columns array. If first
parameter is not defined, the column will be appended to the end.
The second argument columns is the column object or an array of column column objects.
Returns the number of columns it adds.
If you define grid as:
You can add columns by:
or several at a time:
See .columns array for the structre of the column object.