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: 2
Filtered: 2
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: 2
Filtered: 2
Selected: 0
Data Loading... Please wait
| id ▲▼ | username ▲▼ | theme ▲▼ | Actions |
|---|
| 1 | admin | emerald |
|
| 2 | [email protected] | violet |
|
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.
AG Grid - Multiple Tables Example
This example shows two AG Grid tables rendered side by side with proper isolation and unique identifiers.
Option 1: Side by Side Layout
User Management
api_access_log Management
User Data