Server IP : 127.0.0.2 / Your IP : 3.22.217.190 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/public/js/ |
Upload File : |
/**** Tables Dynamic Server ****/ function tableDynamicServer(){ if ($('.table-dynamic-2').length && $.fn.dataTable) { $('.table-dynamic-2').each(function () { var tableObj; var tableDOM = $(this); if ($(this).hasClass('server-filter')) { var option = {}; // var option = {}; option.processing= true; option.serverSide= true; option.ajax= { url:$(this).data("url"), type: "get", data: function ( d ) { $pageNumber = (d.start/d.length)+1; //console.log($pageNumber); d.page = $pageNumber; }, complete: function (response) { var ajax_complete = tableDOM.data("response-complete"); if (window[ajax_complete] && $.isFunction(window[ajax_complete])) { window[ajax_complete](response); } }, }; option.columns= []; option.order = []; option.pageLength= 10; var table_opt = $(this).data("table-option"); if (window[table_opt] && $.isFunction(window[table_opt])) { option = window[table_opt](option); } $(this).find('thead th').each( function () { if ($(this).hasClass('col-filter')) { var title = $('.filter-head thead th').eq($(this).index()).text(); $(this).append( '<input type="text" onclick="stopPropagation(event);" class="form-control" style="width: 100%;" placeholder="Filter '+title+'" />' ); } var thead=$(this); option.columns.push({data:thead.data("column"),orderable:thead.data("order")}); }); tableObj = $(this).DataTable(option); $(".server-filter thead input").on( 'keyup change', function () { tableObj.column( $(this).parent().index()+':visible').search( this.value ).draw(); }); // console.log(option); }else{ tableObj = $(this).DataTable(); } var table_fn = $(this).data("table-obj"); if (window[table_fn] && $.isFunction(window[table_fn])) { result = window[table_fn](tableObj); } }); } } $(document).ready(function () { tableDynamicServer(); });