Update 2024-02-08: datatable show-detail fixed, change icon. Close-all function except sidebar modal.
This commit is contained in:
+38
-7
@@ -43,11 +43,19 @@ var FoniaJS = {
|
||||
_hasil = $.base64.decode(skey);
|
||||
_adata = _hasil.split(";");
|
||||
this.User.ID = _adata[0];
|
||||
this.User.UID = _adata[1];
|
||||
this.User.GID = _adata[2];
|
||||
this.User.Level = _adata[3];
|
||||
this.User.UID = parseInt(_adata[1]);
|
||||
this.User.GID = parseInt(_adata[2]);
|
||||
this.User.Level = parseInt(_adata[3]);
|
||||
}
|
||||
},
|
||||
user_level: function(l) {//oke
|
||||
if (this.User.Level <= (l ?? 9)) return true;
|
||||
return false;
|
||||
},
|
||||
user_level_not: function(l) {//oke
|
||||
if (this.User.Level !== (l ?? 9)) return true;
|
||||
return false;
|
||||
},
|
||||
callMenu: function(p, q) {//oke
|
||||
var apar = ["p=" + p];
|
||||
if (q != null) apar.push("q=" + q);
|
||||
@@ -479,6 +487,7 @@ var FoniaJS = {
|
||||
showWindow: function(id_wind, s_judul, s_isi, i_width, s_toolb, f_onload, b_scroll) {//oke
|
||||
var t_width = '', t_toolb = '', t_scroll = (typeof b_scroll == 'boolean' && b_scroll == false) ? '' : 'modal-dialog-scrollable';
|
||||
var f_oncall = (typeof f_onload == "function") ? f_onload : function(){};
|
||||
if (typeof i_width == 'string') { t_width = 'modal-'+i_width; } else
|
||||
if (i_width <= 300) { t_width = 'modal-sm'; } else
|
||||
if (i_width <= 400) { t_width = 'modal-400'; } else
|
||||
if (i_width <= 500) { t_width = 'modal-500'; } else
|
||||
@@ -512,7 +521,7 @@ var FoniaJS = {
|
||||
closeAllWindows: function() {//oke
|
||||
$(".modal").each(function() {
|
||||
if ($(this).hasClass('show')) $(this).modal('toggle');
|
||||
if ($(this).get('id')!=='sidebarMain') $(this).modal('dispose').remove();
|
||||
if ($(this).attr('id')!=='sidebarMain') $(this).modal('dispose').remove();
|
||||
});
|
||||
$(".fon-autotext", ".fon-autopos").each(function() {
|
||||
$(this).remove();
|
||||
@@ -522,8 +531,7 @@ var FoniaJS = {
|
||||
}
|
||||
},
|
||||
setFocus: function(obj) {
|
||||
$(obj).select();
|
||||
$(obj).focus();
|
||||
$(obj).select().focus();
|
||||
},
|
||||
lPad: function(n, width, z) {
|
||||
z = z || "0";
|
||||
@@ -766,7 +774,7 @@ Request.JSONF = function(options){//oke
|
||||
var sClass = '';
|
||||
if (ini.config.css) sClass += ' '+ini.config.css;
|
||||
if (ini.config.func_select) sClass += ' table-select';
|
||||
var strTab = '<table id="'+ini.id+'Tabel" class="table table-striped table-bordered table-hover'+sClass+' datatable">';
|
||||
var strTab = '<table id="'+ini.id+'Tabel" class="table table-striped table-bordered table-hover'+sClass+'">';
|
||||
|
||||
var strBody = '<tbody>';
|
||||
$.each(ini.content, function(key, val){
|
||||
@@ -972,6 +980,29 @@ Request.JSONF = function(options){//oke
|
||||
}
|
||||
});
|
||||
}
|
||||
//if (ini.config.live){
|
||||
$('#'+ini.id+'Tabel tbody').on('click', 'td.dtr-control', function(){
|
||||
var tr = $(this).closest('tr');
|
||||
var row = otabel.row(tr);
|
||||
if (row.child.isShown()){
|
||||
row.child.hide();
|
||||
tr.removeClass('dt-hasChild parent');
|
||||
}else{
|
||||
var ind = 0;
|
||||
var tampil = '<ul class="list-unstyled">';
|
||||
api.columns().every(function() {
|
||||
var kol = this.header();
|
||||
if (kol.className.indexOf('dtr-hidden') != -1){
|
||||
tampil += '<li class="py-1"><span class="d-inline-block" style="min-width:100px;">' + kol.textContent + '</span><span class="text-break">' + row.data()[ind] + '</span></li>';
|
||||
}
|
||||
ind++;
|
||||
})
|
||||
tampil += '</ul>';
|
||||
row.child(tampil).show();
|
||||
tr.addClass('dt-hasChild parent');
|
||||
}
|
||||
});
|
||||
//}
|
||||
}
|
||||
var otabel = $('#'+ini.id+'Tabel').DataTable(opsi);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user