Reusable datatable control that hooks up to any of our REST APIs
* Implements item selection (single, shift, ctrl), pagination, and sorting. To be used in the future. * Added example code for how to use the table widget * Temporarily added a table test page to the DashboardController
This commit is contained in:
parent
2d2ed25fcc
commit
ffdc83dc26
7 changed files with 411 additions and 21 deletions
30
airtime_mvc/application/common/widgets/Table.php
Normal file
30
airtime_mvc/application/common/widgets/Table.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: asantoni
|
||||
* Date: 11/09/15
|
||||
* Time: 2:47 PM
|
||||
*/
|
||||
|
||||
class AirtimeTableView {
|
||||
|
||||
private static function _getTableJavaScriptDependencies() {
|
||||
return ['js/airtime/widgets/table.js',
|
||||
'js/datatables/js/jquery.dataTables.js',
|
||||
'js/datatables/plugin/dataTables.pluginAPI.js',
|
||||
'js/datatables/plugin/dataTables.fnSetFilteringDelay.js',
|
||||
'js/datatables/plugin/dataTables.ColVis.js',
|
||||
'js/datatables/plugin/dataTables.colReorder.min.js?',
|
||||
'js/datatables/plugin/dataTables.FixedColumns.js',
|
||||
'js/datatables/plugin/dataTables.FixedHeader.js',
|
||||
'js/datatables/plugin/dataTables.columnFilter.js?'];
|
||||
}
|
||||
|
||||
public static function injectTableJavaScriptDependencies(&$headScript, $baseUrl, $airtimeVersion)
|
||||
{
|
||||
$deps = self::_getTableJavaScriptDependencies();
|
||||
for ($i = 0; $i < count($deps); $i++) {
|
||||
$headScript->appendFile($baseUrl . $deps[$i] .'?'. $airtimeVersion, 'text/javascript');
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue