getColumns
returns an array of columns
function getColumns( // defines whether to include the hidden columns all?: boolean): WebixDatatableColumn[]
Returns
Section titled “Returns”WebixDatatableColumn[]
an array of column objects
Example
Section titled “Example”// hide the title columngrid.hideColumn("title");// get all the columns including the hidden "title" columnvar allColumns = grid.getColumns(true);
also check the next samples:
Details
Section titled “Details”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 columnsvar columns = grid.getColumns(true);
// add new columncolumns.splice(columns.length-1, 0, { id: "col_"+count, header:"Column "+count, hidden:true});
// repaint the grid with modified datagrid.refreshColumns(columns);
See also
Section titled “See also”Articles
API