Flexible Data Table Plugin With jQuery And PHP - OpenDataTable

File Size: 846 KB
Views Total: 10960
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Flexible Data Table Plugin With jQuery And PHP - OpenDataTable

OpenDataTable is a jQuery plugin used to render flexible, dynamic, sortable, searchable, pagintable, editable data tables from PHP & MySQL data sources.

How to use it:

1. Insert jQuery library together with jQuery OpenDataTable plugin's JavaScript and stylesheet into the the document.

<link rel="stylesheet" href="style.css">
<script src="//code.jquery.com/jquery.min.js"></script>
<script src="OpenDataTable.js"></script>

2. Create an empty table element for the OpenDataTable.

<table class="OpenDataTable">
 <thead>
   <tr>
      <th>Code</th>
      <th>Name</th>
      <th>Continent</th>
    </tr>
 </thead>
  <tbody>
  </tbody>
</table>

3. Initialize the OpenDataTable plugin and specify the data source you want to use.

$(".OpenDataTable").OpenDataTable({  
  url:"datasource.php"
});

4. More configuration options.

$(".OpenDataTable").OpenDataTable({  

  // data source
  url:"api.php",

  // for sortable
  default_sort:{
    sort_col:'', // 0 for col 1, 1 for col 2  and on
    sort_type:'' // 'DESC' or 'ASC'
  },

  // hide search input
  hide_search: false,

  // hide when no recorders
  hide_no_of_rec: false,

  // callback function
  callback: function() {}
  
});

This awesome jQuery plugin is developed by opendatatable. For more Advanced Usages, please check the demo page or visit the official website.