Recommend this page to a friend! |
Download |
Info | Documentation | Demos | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
79% | Total: 999 | All time: 3,651 This week: 41 |
Version | License | PHP version | Categories | |||
ajax-table 1.0.1 | MIT/X Consortium ... | 5.4 | HTML, Localization, PHP 5, AJAX |
Collaborate with this project | Author | |||
ajaxtable - github.com Description This package can load HTML tables dynamically using AJAX. Innovation Award
|
AjaxTable is separated in two steps, configuration for build table and response after ajax request.
For configuration, is required to instanciate Conf to put all configuration, as below:
$Conf = new VectorDev\AjaxTable\Conf(base_url(['user', 'ajax-list']));
Conf will store all the information to generate a json for js lib
To create columns for your table, you will need to instanciate Column with information that you need to display.
$ColumnName = new VectorDev\AjaxTable\Column('username', 'Username');
$ColumnEmail = new VectorDev\AjaxTable\Column('email', 'E-mail');
$ColumnAge = new VectorDev\AjaxTable\Column('age', 'Age');
Column will store all the information about your table column.
After this, you need to add Column to your configuration.
$Conf->addColumn($ColumnName);
$Conf->addColumn($ColumnEmail);
$Conf->addColumn($ColumnAge);
To finish, you will build json configuration for AjaxTable js lib.
<script>
jQuery().ready(function(){
$('#table').ajaxTable(<?php echo $Conf->getJson(); ?>);
});
</script>
And done, your table is now configurated to work as ajaxtable to request and print data.
For response, is required to work with Response, Row and Cell classes to get request, work with data and response to view.
$Response = new VectorDev\AjaxTable\Response();
$Response->setRowsTotal($total_rows);
$limit = $Response->getLimitForSql(); // AjaxTable automatic build array for your use directly in your query
$order = $Response->getOrderByForSql(); // AjaxTable automatic build array with order by too
foreach($all_data as $data) {
$CellUsername = new VectorDev\AjaxTable\Cell($data['user_username']);
$CellEmail = new VectorDev\AjaxTable\Cell($data['user_mail']);
$CellAge = new VectorDev\AjaxTable\Cell($data['user_age']);
$Row = new VectorDev\AjaxTable\Row($CellUsername, $CellEmail, $CellAge);
$Response->addRow($Row);
}
$Response->returnRequest();
AjaxTable is PHP and JavaScript library to build tables with ajax to get and display data. Different from another js plugins, AjaxTable build all table data and send to view, so javascript not be heavy on your page.
AjaxTable support pagination, responsive, i18n and more. You can change style, add html classes, change strings in your Language class and more.
Want to see more? We have a demo here.
1 - For install, you can use composer as below
composer require vectordev/ajaxtable
or download tarball and include autoload.php
in your code as require.
2 - Copy all files on js
and css
folder to your assets folder and include in your page.
To see this library in action, see usage.md.
Files (25) | / | css |
File | Role | Description |
---|---|---|
ajaxtable-responsive.css | Data | Auxiliary data |
ajaxtable-responsive.min.css | Data | Auxiliary data |
ajaxtable.css | Data | Auxiliary data |
ajaxtable.min.css | Data | Auxiliary data |
Files (25) | / | examples |
File | Role | Description |
---|---|---|
index.php | Example | Example script |
numbers.php | Example | Example script |
numbers.sql | Data | Auxiliary data |
Files (25) | / | js |
File | Role | Description |
---|---|---|
ajaxtable.js | Data | Auxiliary data |
ajaxtable.min.js | Data | Auxiliary data |
Files (25) | / | src |
File | Role | Description | ||
---|---|---|---|---|
Format (3 files) | ||||
Lang (2 files) | ||||
autoload.php | Aux. | Auxiliary script | ||
Cell.php | Class | Class source | ||
Col.php | Class | Class source | ||
Column.php | Class | Class source | ||
Conf.php | Class | Class source | ||
Response.php | Class | Class source | ||
Row.php | Class | Class source |
Files (25) | / | src | / | Format |
File | Role | Description |
---|---|---|
Classes.php | Class | Class source |
Format.php | Class | Class source |
Table.php | Class | Class source |
Files (25) | / | src | / | Lang |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Ratings | User Comments (4) | |||||||||||||||||||||||||||||||||||||||||||
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.