UI: implemented saimod_table_config sort

This commit is contained in:
Messerbill 2015-06-08 18:49:25 +02:00
parent a36abc2f1b
commit 981f42ea8a
4 changed files with 24 additions and 43 deletions

View File

@ -1,49 +1,30 @@
function init_saimod_sys_config() {
$('#tabs_config a').click(function (e) {
$('#tabs_config li').each(function(){
$(this).removeClass('active');});
$(this).parent().addClass('active');
});
saimod_config_tablesort("sai_mod_table_basics");
}
function init_saimod_sys_config_basics() {
$('#tabs_config li').each(function(){
$(this).removeClass('active');});
$('#menu_tag_basics').parent().addClass('active');
saimod_config_tablesort("sai_mod_table_basics");
}
function init_saimod_sys_config_database() {
$('#tabs_config li').each(function(){
$(this).removeClass('active');});
$('#menu_tag_database').parent().addClass('active');
saimod_config_tablesort("sai_mod_table_database");
}
function init_saimod_sys_config_sai() {
$('#tabs_config li').each(function(){
$(this).removeClass('active');});
$('#menu_tag_sai').parent().addClass('active');
saimod_config_tablesort("sai_mod_table_sai");
}
function config_menu(){
$('#tabs_config li').each(function(){
$(this).removeClass('active');});
if($('#menu_tag__'+system.cur_state().split('.')[1]).length){
$('#menu_tag__'+system.cur_state().split('.')[1]).parent().addClass('active');
} else {
$('menu_tag_basics').parent().addClass('active');}
}
/*
var table_basics = document.getElementById('sai_mod_config_table_basics');
var sort = new Tablesort(table_basics);
function sort_table(){
console.log("testme");
}
table_basics.addEventListener('beforeSort', function() {
alert('Table is about to be sorted!');
});
table_basics.addEventListener('afterSort', function() {
alert('Table sorted!');
});*/
function saimod_config_tablesort(id){
var table_basics = document.getElementById(id);
var sort = new Tablesort(table_basics, {descending: true});
sort.refresh();
}

View File

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

View File

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

View File

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