tss-grid v0.0.13
You can Install the my library using
npm i tss-grid
After running the command in command prompt of your project directory
You need to install primeng to install that run the following command
ng i primeng --save
in command prompt
After that for styles to apply the application
- Insert the following link in angular.json in styles as
"./node_modules/font-awesome/css/font-awesome.css",
"./node_modules/primeng/resources/themes/omega/theme.css",
"./node_modules/primeng/resources/primeng.min.css"
After that install font-awesome using
ng i font-awesome --save
import the module in the app.module.ts file(import { TssGridModule} from 'tss-grid').
import the type in the imports of @NgModule(TssGridModule).
Use the selector in app.component.html which will be present in the component of your library. as
<lib-data-table *ngIf='styling && styling=="data-table"' [options] ="options"></lib-data-table>
<lib-data-view *ngIf='styling && styling=="data-view"' [options]="options"></lib-data-view>
import the Interface from tss-grid library in whichever component you have to use
Import {DataGridoptions} from 'tss-grid'
- Now assign json to options as:
this.options = {
col:[{field: 'Model',header:"Sno"},{field: 'Name',header:"Sname"},{field: "Description",header:"Description"}],
rows:[{Model:"1",Name:"Benz",Description:"Nice Car"},
{Model:"2",Name:"RangeRover",Description:"Costly Car"}],
globalFilter:true,
styling: "data-view",
paginator:false,
rowsperpage:10
}
ForDemo Visit: TssGrid