Skip to content

getColumns

returns an array of columns

function getColumns(
// defines whether to include the hidden columns
all?: boolean
): WebixDatatableColumn[]

WebixDatatableColumn[] 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);

also check the next 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 DataGrid 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 grid with modified data
grid.refreshColumns(columns);

Articles

API