Skip to main content

api.getColumn(id)

Description

Gets an object with the column configuration

Usage

api.getColumn(id): object;

Parameters

  • id - the id of a column

Returns

The method returns an object with the column parameters:

{
id: string,
width: number,
flexgrow?: number,
editor?: string | any,
setter?: (obj: {}, value: Value) => void,
getter?: (obj: {}) => Value,
hidden?: boolean,
options?: [],
header?: string | [],
footer?: string | [],
resize?: boolean,
treetoggle?: boolean,
cell?: any,
tooltip?: boolean | (obj: any) => any,
template?: any,
draggable?: boolean | (row:obj, column:obj) => booolean
}

Example

The example below shows how to output the "city" column configuration to the console:

<script>
import { getData } from "./common/data";
import { Grid } from "wx-svelte-grid";

const { data, columns } = getData();

function init(api){
const column = api.getColumn("city");
console.log("Column:", column);
}
</script>

<Grid {data} {columns} {init} />

Related articles: