Typescript Web ComponentsTypescript Web ComponentsTypescript support comes with the next version of Smart Web Components. We are super excited about this. We will expose Interfaces, Types and Classes for all our stuff. Each API member will include descriptions, which will help you to use our product and see the intellisense suggestions by Visual Studio Code, Visual Studio and other IDEs with such support. Grid Typescript InitThis sample shows how to create basic Grid using TypeScript import {Grid, GridColumn, DataAdapter, Smart} from "../typescript/smart.elements"; window.onload = function () { const grid: Grid = <Grid>document.createElement("smart-grid"); grid.columns = <GridColumn[]>[ {label: "First Name", dataField: "firstName"}, {label: "Last Name", dataField: "lastName"} ] const adapter = new Smart.DataAdapter( { dataSource: [ {firstName: "Name", lastName: "Last Name"}, {firstName: "Name 2", lastName: "Last Name 2"}, {firstName: "Name 3", lastName: "Last Name 3"}, {firstName: "Name 4", lastName: "Last Name 4"}, {firstName: "Name 5", lastName: "Last Name 5"} ], dataFields: [ 'firstName: string', 'lastName: string' ] }) as DataAdapter; grid.dataSource = adapter; document.body.appendChild<Grid>(grid); }
This entry was posted in Smart Grid, Web Components and tagged Grid, ts, ts grid, typescript, typescript language, typescript web components, typing web components, typings, web components. Bookmark the permalink.
|
|