THEMETRIAL

Simple Fast Data Table JavaScript Library – RdataTB

Author:Rakhmadi
Views Total:0 views
Official Page:Go to website
Last Update:June 7, 2021
License:MIT

Preview:

Simple Fast Data Table JavaScript Library – RdataTB

Description:

RdataTB is a simple plain JavaScript library that helps you generate user-friendly data tables from regular HTML tables.

Features:

  • Table Pagination & Navigation.
  • Allows you to select how many rows to display per page.
  • Live table data filter.
  • Export table to JSON or CSV.
  • Sort tabular data by clicking table headers.
  • Compatible with any frameworks like Bootstrap 5.

How to use it:

1. Import the RdataTB’s main JavaScript into the document.

<script src=”./dist/index.js”></script>

2. Just initialize the RdataTB on the existing HTML table and done.

<table id="myTable">
  <thead>
    <tr>
      <th>Name</th>
      <th>Ext.</th>
      <th>City</th>
      <th is-type="date" data-format="YYYY/MM/DD">Start Date</th>
      <th>Completion</th>
    </tr>
  </thead>
  <tbody>
    ...
  </tbody>
</table>
let myDataTable = new RdataTB('myTable');

3. Download the HTML data as a CSV file.

myDataTable.DownloadCSV('fileName');

4. Download the HTML data as a JSON file.

myDataTable.DownloadJSON('fileName');

5. Sort a specific column.

myDataTable.sort('columnName');

6. Go to the next or prev page.

myDataTable.nextItem();
myDataTable.prevItem();

7. Properties.

// get table data in JSON format
myDataTable.DataTableRaw

// get all column names
myDataTable.HeaderDataTable

// get data in row
myDataTable.RowDataTable

// get data
myDataTable.DataToRender


Source link

Add comment

NOTE :

All visitors can share my site’s content on their blogs, sites, and social networks to enrich the content

Only share the source www.themetrial.com

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.