table child update
This commit is contained in:
+4
-16
@@ -4,9 +4,9 @@
|
||||
Desc. : CSS Default Configuration
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : December 20th, 2007.
|
||||
Last Modified : December 16th, 2023.
|
||||
Last Modified : December 5th, 2025.
|
||||
|
||||
(c) 2009 - 2023, 3FONIA Software; WWW.3FONIA.COM.
|
||||
(c) 2009 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
@@ -75,20 +75,8 @@ table.dataTable.table-bordered th {
|
||||
table.dataTable.table-bordered tr:last-child td {
|
||||
border-bottom-width: 1px !important;
|
||||
}
|
||||
table.dataTable a.fon-tabel-dt i {
|
||||
padding-top: 2px;
|
||||
width: 1.5rem !important;
|
||||
height: 1.5rem !important;
|
||||
border: 0.15em solid white;
|
||||
border-radius: .7em;
|
||||
box-shadow: 0 0 0.2em #444;
|
||||
background-color: #31b131;
|
||||
}
|
||||
table.dataTable tr.dt-hasChild a.fon-tabel-dt i {
|
||||
background-color: #d33333;
|
||||
}
|
||||
table.dataTable a.fon-tabel-dt:hover i, table.dataTable tr.dt-hasChild a.fon-tabel-dt:hover i {
|
||||
color: unset;
|
||||
table.dataTable.table-hover tbody tr:has(td > div.fon-tabel-child):hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
div.dataTables_wrapper div.toolbar button {
|
||||
font-size: unset;
|
||||
|
||||
+35
-34
@@ -4,7 +4,7 @@
|
||||
Desc. : JS - Fonia Custom Class v3
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : June 19th, 2009.
|
||||
Last Modified : December 3rd, 2025.
|
||||
Last Modified : December 4th, 2025.
|
||||
|
||||
(c) 2009 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
@@ -759,7 +759,7 @@ Request.JSONF = function(options){//oke
|
||||
strAksi = '<input class="form-check-input" type="checkbox" id="'+ini.id+'_cbhead_'+val.field+'" value="'+val.avalue[1]+'">';
|
||||
ChkField = val.field;
|
||||
}
|
||||
if (val.type == 'button') aTombol[val.icon] = val.label;
|
||||
if ($.inArray(val.type,['button','button-dt'])!==-1) aTombol[val.icon] = [val.label, (val.type=='button'?0:1)];
|
||||
});
|
||||
strHead += '<th data-class-name="c">'+strAksi+'</th>';
|
||||
aSortCol.push(null);
|
||||
@@ -800,14 +800,14 @@ Request.JSONF = function(options){//oke
|
||||
if (ini.option.length > 0) {
|
||||
if (val[0].button.length > 0) {
|
||||
$.each(val[0].button, function(keyb, valb){
|
||||
var _icon = (valb[0]=='fon-tabel-dt') ? 'pencil' : valb[0];
|
||||
var _link = (aTombol[valb[0]][1]==1) ? 'fon-tabel-dt' : valb[0];
|
||||
var _cssa = (valb[1]=='') ? '' : ' text-'+valb[1];
|
||||
var _cssb = (valb[1]=='') ? ' normal' : ' btn-'+valb[1];
|
||||
if (ini.config.txtbutton === true) {
|
||||
_tbtn1 += '<button class="btn tbl-rowbtn d-none d-lg-inline-block '+valb[0]+_cssb+' me-2" type="button">'+aTombol[valb[0]]+'</button>';
|
||||
_tbtn2 += '<a class="table-icon d-lg-none '+valb[0]+_cssa+'" tabindex="-1" title="'+aTombol[valb[0]]+'"><i class="icon cui-'+_icon+'"></i></a>';
|
||||
_tbtn1 += '<button class="btn tbl-rowbtn d-none d-lg-inline-block '+_link+_cssb+' me-2" type="button">'+aTombol[valb[0]][0]+'</button>';
|
||||
_tbtn2 += '<a class="table-icon d-lg-none '+_link+_cssa+'" tabindex="-1" title="'+aTombol[valb[0]][0]+'"><i class="icon cui-'+valb[0]+'"></i></a>';
|
||||
} else {
|
||||
_tbtn2 += '<a class="table-icon '+valb[0]+_cssa+'" title="'+aTombol[valb[0]]+'"><i class="icon cui-'+_icon+'"></i></a>';
|
||||
_tbtn2 += '<a class="table-icon '+_link+_cssa+'" title="'+aTombol[valb[0]][0]+'"><i class="icon cui-'+valb[0]+'"></i></a>';
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -858,14 +858,14 @@ Request.JSONF = function(options){//oke
|
||||
if (ini.option.length > 0) {
|
||||
if (optval.button.length > 0) {
|
||||
$.each(optval.button, function(keyb, valb){
|
||||
var _icon = (valb[0]=='fon-tabel-dt') ? 'pencil' : valb[0];
|
||||
var _link = (aTombol[valb[0]][1]==1) ? 'fon-tabel-dt' : valb[0];
|
||||
var _cssa = (valb[1]=='') ? '' : ' text-'+valb[1];
|
||||
var _cssb = (valb[1]=='') ? ' normal' : ' btn-'+valb[1];
|
||||
if (ini.config.txtbutton === true) {
|
||||
_tbtn1 += '<button class="btn tbl-rowbtn d-none d-lg-inline-block '+valb[0]+_cssb+' me-2" type="button">'+aTombol[valb[0]]+'</button>';
|
||||
_tbtn2 += '<a class="table-icon d-lg-none '+valb[0]+_cssa+'" tabindex="-1" title="'+aTombol[valb[0]]+'"><i class="icon cui-'+_icon+'"></i></a>';
|
||||
_tbtn1 += '<button class="btn tbl-rowbtn d-none d-lg-inline-block '+_link+_cssb+' me-2" type="button">'+aTombol[valb[0]][0]+'</button>';
|
||||
_tbtn2 += '<a class="table-icon d-lg-none '+_link+_cssa+'" tabindex="-1" title="'+aTombol[valb[0]][0]+'"><i class="icon cui-'+valb[0]+'"></i></a>';
|
||||
} else {
|
||||
_tbtn2 += '<a class="table-icon '+valb[0]+_cssa+'" title="'+aTombol[valb[0]]+'"><i class="icon cui-'+_icon+'"></i></a>';
|
||||
_tbtn2 += '<a class="table-icon '+_link+_cssa+'" title="'+aTombol[valb[0]][0]+'"><i class="icon cui-'+valb[0]+'"></i></a>';
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -960,32 +960,33 @@ Request.JSONF = function(options){//oke
|
||||
this.checked = this.value == val.avalue[0];
|
||||
});
|
||||
} else if (val.type == 'button'){
|
||||
if (val.icon == 'fon-tabel-dt'){
|
||||
$('#'+ini.id+'Tabel tbody').on('click', '.fon-tabel-dt', function(){
|
||||
var tr = $(this).closest('tr');
|
||||
var row = otabel.row(tr);
|
||||
if (row.child.isShown()){
|
||||
row.child.hide();
|
||||
tr.removeClass('shown');
|
||||
}else{
|
||||
var fnc = val.func.split('.');
|
||||
if (typeof window[fnc[0]][fnc[1]] === 'function'){
|
||||
var _dt_id = $('<div id="TD_Fonia_' + parseInt(Math.random() * 99999999) + '" />');
|
||||
row.child(_dt_id).show();
|
||||
tr.addClass('shown');
|
||||
window[fnc[0]][fnc[1]](row.data(), _dt_id);
|
||||
} else console.warn('fungsi '+val.func+' tidak ada !');
|
||||
$('#'+ini.id+'Tabel tbody').on('click', '.'+val.icon, function(){
|
||||
var dta = otabel.row($(this.closest('tr'))).data();
|
||||
var fnc = val.func.split('.');
|
||||
if (typeof window[fnc[0]][fnc[1]] === 'function') { window[fnc[0]][fnc[1]](dta, this); }
|
||||
else if (typeof window[fnc[0]] === 'function') { window[fnc[0]](dta, this); }
|
||||
else console.warn('fungsi '+val.func+' tidak ada !');
|
||||
});
|
||||
} else if (val.type == 'button-dt'){
|
||||
$('#'+ini.id+'Tabel tbody').on('click', '.fon-tabel-dt', function(){
|
||||
var tr = $(this).closest('tr');
|
||||
var row = otabel.row(tr);
|
||||
if (row.child.isShown()){
|
||||
row.child.hide();
|
||||
tr.removeClass('shown');
|
||||
}else{
|
||||
if (otabel.row('.shown').length){
|
||||
$('.fon-tabel-dt', otabel.row('.shown').node()).click();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#'+ini.id+'Tabel tbody').on('click', '.'+val.icon, function(){
|
||||
var dta = otabel.row($(this.closest('tr'))).data();
|
||||
var _dt_id = $('<div id="TD_Fonia_' + parseInt(Math.random() * 99999999) + '" class="fon-tabel-child" />');
|
||||
row.child(_dt_id).show();
|
||||
tr.addClass('shown');
|
||||
var fnc = val.func.split('.');
|
||||
if (typeof window[fnc[0]][fnc[1]] === 'function') { window[fnc[0]][fnc[1]](dta, this); }
|
||||
else if (typeof window[fnc[0]] === 'function') { window[fnc[0]](dta, this); }
|
||||
else console.warn('fungsi '+val.func+' tidak ada !');
|
||||
});
|
||||
}
|
||||
if (typeof window[fnc[0]][fnc[1]] === 'function'){
|
||||
window[fnc[0]][fnc[1]](row.data(), _dt_id);
|
||||
} else console.warn('fungsi '+val.func+' tidak ada !');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user