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: $('#grid').w2grid({ name : 'grid', columns: [ { field: 'recid', caption: 'ID', size: '50px' }, { field: 'email', caption: 'Email', size: '40%' } ], records: [ { recid: 1, fname: 'John', lname: 'doe', email: 'vitali@gmail.com', sdate: '1/3/2012' }, { recid: 2, fname: 'Stuart', lname: 'Motzart', email: 'jdoe@gmail.com', sdate: '2/4/2012' } ] }); You can add columns by: w2ui['grid'].addColumn({ field: 'sdate', caption: 'End Date2', size: '120px' }); or several at a time: w2ui['grid'].addColumn('email', [ { field: 'lname', caption: 'Last Name', size: '30%' }, { field: 'fname', caption: 'First Name', size: '30%' } ]); See .columns array for the structure of the column object.