DataGrid
DataGrid is a special class that can be used to display data in a table format with a filterable and paginated table (datagrid) with just a few lines of code. It is a very powerful tool that can be used to display data from the database, from an API, or a PHP array. Provides a edit/delete buttons and export to csv and tsv.
Example 1: Displaying data from a MySQL table
This example will display the data from the users table in the database. There are switches for Editing or Deleting the data. This is only available for database related DataGrids. The table is filterable and paginated.
Users
Results: 4
Filtered: 4
Selected: 0
Are you sure you want to delete this entry?
Example 2: Displaying data from a MySQL query
This example will render data from a custom query -
SELECT id, username, theme FROM users
Custom query
Results: 4
Filtered: 4
Selected: 0
Example 3: Displaying data from a PHP array
Example 4: Autoloading the DataGrid from Javascript, using the autoloader
This example will autoload the DataGrid from Javascript, using the autoloader. The data is fetched from the database and then passed to the autoloader. Check source code to see how it is done.