sintonia/airtime_mvc/application/common/widgets/Table.php
Albert Santoni ffdc83dc26 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
2015-09-15 14:18:35 -04:00

30 lines
No EOL
1 KiB
PHP

<?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');
}
}
}