returns an array of columns

array getColumns( [boolean all] );
allbooleandefines whether to include the hidden columns
arrayan array of column objects


// hide the title column
// get all the columns including the hidden "title" column
var allColumns = $$("grid").getColumns(true);

Related samples


By default the method returns a copy of all visible columns. If you need to include hidden columns as well, pass true as a parameter.

The method can be used to manipulate the Datatable with hidden columns:

// get a copy of all the columns
var columns = $$("grid").getColumns(true);
// add new column 
columns.splice(columns.length-1, 0, {
  id: "col_"+count,
  header:"Column "+count, 
// repaint the table with modified data
See also
Back to top