Open fullscreen | Source on github | Edit on stackblitz
This example shows how to configure datagrid columns:
import '@activewidgets/html';
import { northwind } from "@activewidgets/examples/data";
const el = document.querySelector('ax-datagrid');
el.columns = [
{header: 'Code', field: 'customerID', width: 80, style: 'background:#def', fixed: true},
{header: 'Company Name', field: 'companyName', width: 160},
{header: 'Contact', field: 'contactName', width: 120},
{header: 'Title', field: 'contactTitle', width: 120},
{header: 'Address', field: 'address', width: 120},
{header: 'City', field: 'city'},
{header: 'Zip', field: 'postalCode', align: 'right'},
{header: 'Phone', field: 'phone'},
{header: 'Fax', field: 'fax'},
{header: 'Country', field: 'country'}
];
el.rows = northwind.customers;Assign an array of column descriptor objects to the columns property.
Read more: