datatable fixed decodeuri
This commit is contained in:
+17
-4
@@ -856,15 +856,29 @@ Request.JSONF = function(options){//oke
|
|||||||
$(vars.data).map(function(key, item){
|
$(vars.data).map(function(key, item){
|
||||||
var keyval = item.split("=");
|
var keyval = item.split("=");
|
||||||
if (keyval[0] == 'SID') keyval[1] = parseInt(Math.random() * 99999999);
|
if (keyval[0] == 'SID') keyval[1] = parseInt(Math.random() * 99999999);
|
||||||
if (keyval[0] == 'Cari_Jual') keyval[1] = decodeURI(keyval[1]);
|
if ((''+keyval[1]).indexOf('%20') != -1) keyval[1] = decodeURI(keyval[1]);
|
||||||
return post_data[keyval[0]] = keyval[1];
|
return post_data[keyval[0]] = keyval[1];
|
||||||
});
|
});
|
||||||
opsi.serverSide = true;
|
opsi.serverSide = true;
|
||||||
opsi.ajax = {
|
opsi.ajax = {
|
||||||
url: vars.url,
|
url: vars.url,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
dataType: 'json',
|
||||||
cache: false,
|
cache: false,
|
||||||
data: post_data,
|
data: post_data,
|
||||||
|
/*success: function(){
|
||||||
|
var _lmenu = [];
|
||||||
|
$.each([10,25,50], function(key, val){
|
||||||
|
if (val > ini.content.length) return false;
|
||||||
|
_lmenu.push(val);
|
||||||
|
});
|
||||||
|
if (10 > ini.content.length){
|
||||||
|
opsi.lengthMenu.push([10],[10]);
|
||||||
|
}else{
|
||||||
|
_lmenu.push(-1), opsi.lengthMenu.push(_lmenu), _lmenu.pop();
|
||||||
|
_lmenu.push(ini.content.length), opsi.lengthMenu.push(_lmenu);
|
||||||
|
}
|
||||||
|
},*/
|
||||||
dataFilter: function(data){
|
dataFilter: function(data){
|
||||||
var json = jQuery.parseJSON(data), jsono = {};
|
var json = jQuery.parseJSON(data), jsono = {};
|
||||||
jsono.draw = json[0].draw;
|
jsono.draw = json[0].draw;
|
||||||
@@ -944,9 +958,8 @@ Request.JSONF = function(options){//oke
|
|||||||
if (ini.navi.button) $('#'+ini.id+'Tabel_wrapper div.toolbar').html(_navibar);
|
if (ini.navi.button) $('#'+ini.id+'Tabel_wrapper div.toolbar').html(_navibar);
|
||||||
}
|
}
|
||||||
opsi.drawCallback = function(settings){
|
opsi.drawCallback = function(settings){
|
||||||
/*var api = this.api();
|
//var api = this.api();
|
||||||
console.log( api.rows( {page:'current'} ).data() );
|
//console.log( api.rows( {page:'current'} ).data() );
|
||||||
console.log( settings );*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var otabel = $('#'+ini.id+'Tabel').DataTable(opsi);
|
var otabel = $('#'+ini.id+'Tabel').DataTable(opsi);
|
||||||
|
|||||||
+1
-1
@@ -258,7 +258,7 @@ final class Table {
|
|||||||
|
|
||||||
$adata['data'] = [];
|
$adata['data'] = [];
|
||||||
$this->__cdb->Query("SELECT ".$this->__tfield." FROM ".$this->__ttable.$this->__twhere.$sql_order.$sql_limit);
|
$this->__cdb->Query("SELECT ".$this->__tfield." FROM ".$this->__ttable.$this->__twhere.$sql_order.$sql_limit);
|
||||||
$adata['sql'] = "SELECT ".$this->__tfield." FROM ".$this->__ttable.$this->__twhere.$sql_order.$sql_limit;
|
//$adata['sql'] = "SELECT ".$this->__tfield." FROM ".$this->__ttable.$this->__twhere.$sql_order.$sql_limit;
|
||||||
while ($this->__cdb->Next()) {
|
while ($this->__cdb->Next()) {
|
||||||
$abaris = [];
|
$abaris = [];
|
||||||
$aoption = ['button'=>[]];
|
$aoption = ['button'=>[]];
|
||||||
|
|||||||
Reference in New Issue
Block a user