returns an array of columns
all | boolean | defines whether to include the hidden columns |
array | an array of column objects |
// hide the title column
$$("grid").hideColumn("title");
// get all the columns including the hidden "title" column
var allColumns = $$("grid").getColumns(true);
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,
hidden:true
});
// repaint the table with modified data
$$("grid").refreshColumns(columns);