1.0.6 • Published 4 years ago

@shaliniv/reacteditabletable v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

install the package by using npm install @shaliniv/reacteditabletable.

import ReactEditableTable from '@shaliniv/reacteditabletable'.

Use ReactEditableTable as <"ReactEditableTable columns={columns} data={data}"/>

Columns and data is a mandatory field to be added as props for the table. Columns and data cannot contain nested data. Columns is for the columns and data is for the rows. Columns should consists of header and id,filterable=true(optional) field if filtering for columnwise is required. Columns and data are array of objects,in columns there will be header(columnName) and id and the data is accessed by using that as key,for that column row data.

For Example: const columns={ header:"Name", id:"name", filterable:true, className:"columnHeader" }, { header:"College", id:"college", filterable:true, }, { header:"School", id:"school", filterable:true } const data={ name:"Ted", college:"msrit", className:"RowClassName", }, { name:"Ted", college:"rnsit", }, { name:"Rahul", college:"msrc", }, { name:"Anil", college:"lawU", }, { name:"Sachin", college:"GNSU", }

Columns and data can have their own classnames. Each column consists of sorting and filtering.On-click of each row that row can be edited and there is a delete option to delete each row. Cellspacing,cellpadding can be given to the table as props. For example: deleteButtonClassName="colorBlue" className="tableContent" cellPadding="10" cellSpacing="10" defaultPageSize="2" columns={columns} data={data} showPagination={true} sortingByHeader={true} All theses can be added as props to the table. if showPagination is set to {true} then defaultPageSize must be given. The default size fo the page is 5.If no defaultpagesize is given.