angular2-datagrid
Angular2-datagrid provides functionality to create tables, image grid, etc. It allows developer to create desired template.
Demo
See demo here.
To quickly include sample demo in your application, just import TableComponent
import { TableComponent } from 'angular2-datagrid/src/app/demo';
then include it in your template
Make sure your app inlcudes bootstrap css for styling. You can make your own template based on css framework that you prefer.
** NOTE: bootstrap.css is not required, however in order to render it neatly you need to include it for demo purposes.
Getting started
-
Install package.
npm i angular2-datagrid --save
-
Specify your template. This is sample template to view data on table.
Table DemoSearchAdd recordRemove all even IdPage Size51015ActiveUsernameNameActionNo records found.{{user.username}}{{user.name}}DeleteRecently deleted users{{recentlyRemoveUsers | json}} -
Instantiate ng2-datagrid class.
import { NgDataGridModel } from 'angular2-datagrid';this.table = new NgDataGridModel<User>([]);
Documentation
R is read only.
:-) as it is.
searchValue: T
- any object to be used for searchingitems
.currentPageIndex
- :-).pageSize: number
- max record count foritemsOnCurrentPage
.totalRows: number, R
- record count foritems
.totalFilteredRows: number, R
- record count foritemsFiltered
.maxPageIndex: number, R
- calculated based ontotalFilteredRows / pageSize
. See sample usage hereitems: T[]
- all records. Manipulate records hereitemsFiltered: T[], R
- :-).itemsOnCurrentPage, R
- normally this property is used to displayed contents.
angular2-webpack-starter
Based on webpack-starter.