fixed UI: sortable config table

This commit is contained in:
Messerbill 2015-06-08 21:45:26 +02:00
parent 22490ec6ec
commit 883d5c3e29
5 changed files with 47 additions and 33 deletions

View File

@ -1,30 +1,33 @@
function init_saimod_sys_config() { function init_saimod_sys_config() {
saimod_config_tablesort("sai_mod_table_basics"); $("#sai_mod_table_basics").tablesorter();
} }
function init_saimod_sys_config_basics() { function init_saimod_sys_config_basics() {
$("#sai_mod_table_basics").tablesorter();
$('#tabs_config li').each(function(){ $('#tabs_config li').each(function(){
$(this).removeClass('active');}); $(this).removeClass('active');});
$('#menu_tag_basics').parent().addClass('active'); $('#menu_tag_basics').parent().addClass('active');
saimod_config_tablesort("sai_mod_table_basics"); //saimod_config_tablesort("sai_mod_table_basics");
} }
function init_saimod_sys_config_database() { function init_saimod_sys_config_database() {
$("#sai_mod_table_database").tablesorter();
$('#tabs_config li').each(function(){ $('#tabs_config li').each(function(){
$(this).removeClass('active');}); $(this).removeClass('active');});
$('#menu_tag_database').parent().addClass('active'); $('#menu_tag_database').parent().addClass('active');
saimod_config_tablesort("sai_mod_table_database"); //saimod_config_tablesort("sai_mod_table_database");
} }
function init_saimod_sys_config_sai() { function init_saimod_sys_config_sai() {
$("#sai_mod_table_sai").tablesorter();
$('#tabs_config li').each(function(){ $('#tabs_config li').each(function(){
$(this).removeClass('active');}); $(this).removeClass('active');});
$('#menu_tag_sai').parent().addClass('active'); $('#menu_tag_sai').parent().addClass('active');
saimod_config_tablesort("sai_mod_table_sai"); //saimod_config_tablesort("sai_mod_table_sai");
} }
function saimod_config_tablesort(id){ //function saimod_config_tablesort(id){
var table_basics = document.getElementById(id); // var table_basics = document.getElementById(id);
var sort = new Tablesort(table_basics, {descending: true}); // var sort = new Tablesort(table_basics, {descending: true});
sort.refresh(); // sort.refresh();
} //}

View File

@ -1,8 +1,12 @@
<table class="table sai_table" id="sai_mod_table_basics"> <table class="table sai_table tablesorter" id="sai_mod_table_basics">
<tr class="no-sort"> <thead>
<th>ID <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th> <tr>
<th>Name <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th> <th>ID <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th>
<th>Value <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th> <th>Name <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th>
</tr> <th>Value <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th>
${basics} </tr>
</thead>
<tbody>
${basics}
</tbody>
</table> </table>

View File

@ -1,8 +1,12 @@
<table class="table sai_table" id="sai_mod_table_database"> <table class="table sai_table tablesorter" id="sai_mod_table_database">
<tr class="no-sort"> <thead>
<th>ID <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th> <tr>
<th>Name <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th> <th>ID <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th>
<th>Value <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th> <th>Name <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th>
</tr> <th>Value <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th>
${database} </tr>
</thead>
<tbody>
${database}
</tbody>
</table> </table>

View File

@ -1,8 +1,12 @@
<table class="table sai_table" id="sai_mod_table_sai"> <table class="table sai_table tablesorter" id="sai_mod_table_sai">
<tr class="no-sort"> <thead>
<th>ID <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th> <tr>
<th>Name <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th> <th>ID <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th>
<th>Value <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th> <th>Name <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th>
</tr> <th>Value <span class="glyphicon glyphicon-sort" aria-hidden="true"></span></th>
${sai} </tr>
</thead>
<tbody>
${sai}
</tbody>
</table> </table>

View File

@ -33,6 +33,7 @@ class default_page extends \SYSTEM\PAGE\Page {
private static function css(){ private static function css(){
$result = '<link rel="stylesheet" href="'.\LIB\lib_bootstrap::css().'" type="text/css" />'. $result = '<link rel="stylesheet" href="'.\LIB\lib_bootstrap::css().'" type="text/css" />'.
'<link rel="stylesheet" href="'.\LIB\lib_system::css().'" type="text/css" />'. '<link rel="stylesheet" href="'.\LIB\lib_system::css().'" type="text/css" />'.
'<link rel="stylesheet" href="'.\LIB\lib_tablesorter_css::js().'" type="text/css" />'.
'<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/sai_classes.css').'" type="text/css" />'. '<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/sai_classes.css').'" type="text/css" />'.
'<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/sai.css').'" type="text/css" />'; '<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/sai.css').'" type="text/css" />';
return $result; return $result;
@ -42,9 +43,7 @@ class default_page extends \SYSTEM\PAGE\Page {
$result = '<script src="'.\LIB\lib_jquery::js().'" type="text/javascript"></script>'. $result = '<script src="'.\LIB\lib_jquery::js().'" type="text/javascript"></script>'.
'<script src="'.\LIB\lib_bootstrap::js().'" type="text/javascript"></script>'. '<script src="'.\LIB\lib_bootstrap::js().'" type="text/javascript"></script>'.
'<script src="'.\LIB\lib_system::js().'" type="text/javascript"></script>'. '<script src="'.\LIB\lib_system::js().'" type="text/javascript"></script>'.
'<script src="'.\LIB\lib_tablesort::js().'" type="text/javascript"></script>'. '<script src="'.\LIB\lib_tablesorter::js().'" type="text/javascript"></script>'.
'<script src="'.\LIB\lib_tablesort_numeric::js().'" type="text/javascript"></script>'.
'<script src="'.\LIB\lib_tablesort_date::js().'" type="text/javascript"></script>'.
'<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/js/sai.js').'" type="text/javascript"></script>'. '<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/js/sai.js').'" type="text/javascript"></script>'.
'<script src="https://www.google.com/jsapi" type="text/javascript"></script>'. '<script src="https://www.google.com/jsapi" type="text/javascript"></script>'.
//'<script src="https://maps.google.com/maps/api/js?v=3&amp;sensor=false" type="text/javascript"></script>'. //'<script src="https://maps.google.com/maps/api/js?v=3&amp;sensor=false" type="text/javascript"></script>'.