Quantcast
Channel: Free community support — DataTables forums
Viewing all 35413 articles
Browse latest View live

Dom element not aligned with search field

$
0
0

Hi, I would like to add refresh button to my datatable but I have a problem with the position of the button.
I have tried with Custom toolbar elements and with Buttons extension and I have the same problem.
This is part of my code

acquisitionTable = $('#acquisitionsTable').DataTable({
        responsive: true,
        "bLengthChange": false,
            deferRender:    true,
            scrollY:        '70vh',
            scrollCollapse: true,
            scroller:       true,
            dom: 'Bfrtip',
            buttons: [
                {
                    text: 'Refresh<i class="fa fa-refresh"></i>',
                    action: function ( e, dt, node, config ) {
                        alert( 'Button activated' );
                    }
                }
            ],

I have attached the image.

In browser debug I see:
<div class="dt-buttons">
    <a class="dt-button" tabindex="0" aria-controls="acquisitionsTable" href="#">
        <span>Refresh<i class="fa fa-refresh"></i></span>
    </a>
</div>
<div id="acquisitionsTable_filter" class="dataTables_filter">
    <label>Search:<input type="search" class="form-control input-sm" placeholder="" aria-controls="acquisitionsTable">

Do you know what is wrong? The buttons css exist but it doesnt load for the specific element.Thanks


Implementing DataTables into a site hosted through BlogSpot

$
0
0

Hi,

I've been trying to get something to work for essentially weeks now to no avail. I work for a Gaming Website called Chalgyr's Game Room in which we are using DataTables in order to provide a database of all of our published reviews and previews (http://www.chalgyr.com/p/review-library.html). This page works just fine (debugger: ofutac), and the DataTables themselves are awesome.

We are planning on moving templates though the newer one is much more jQuery heavy (http://cgrtest40.blogspot.ca/p/reviews-and-previews.html) and I'm not sure how to get the DataTables to initialize. I've gone bit by bit, I've copied the code in as a whole, I've referenced the CDNs, and I'm just not sure what's getting in the way as I've tried to place the CDN or the code in multiple different areas. I've moved all DataTable references back to (http://cgrtest40.blogspot.ca/p/reviews-and-previews.html) in the meantime like they are on the main site.

I ran the debugger for the test site and it tells me

DataTables debug bookmarklet
DataTables is not available on this page.

Any help would be greatly appreciated.

Thank You!

Need to pass column value as variable to external PHP form.

$
0
0

I'm looking at the example code in the "Cutomised control buttons" post. I want to set a variable equal to a column value in the selected table row and pass it as a parameter to a separate php form page. I am aware that I can create an action that opens the external page when the button is clicked.

Can I modify the following code in a way so that instead of updating the table row as for salary below I set a variable to the (editor.get('salary') value and pass it as a parameter to my separate form page (e.g., /formpage.php?salary=<variable>)?

Thanks.

buttons: [
            { extend: "create", editor: editor },
            { extend: "edit",   editor: editor },
            {
                extend: "selectedSingle",
                text: "Salary +250",
                action: function ( e, dt, node, config ) {
                    // Immediately add `250` to the value of the salary and submit
                    editor
                        .edit( table.row( { selected: true } ).index(), false )
                        .set( 'salary', (editor.get( 'salary' )*1) + 250 )
                        .submit();
                }
            },
            { extend: "remove", editor: editor }
        ]

Bind Datatables to @grid.GetHtml table

$
0
0

Hi Guys, in my CSHTML I have created a

@grid.GetHtml(
fillEmptyRows: false,
tableStyle: "webgrid-table",
headerStyle: "webgrid-header",
footerStyle: "webgrid-footer",
alternatingRowStyle: "webgrid-alternating-row",
rowStyle: "webgrid-row-style",

mode: WebGridPagerModes.All,

)

Can you guide me to apply datatables style ?

Regards

Inline Editing stopped working since AJAX customized?

$
0
0

Hi there,

Since changing my ajax from

ajax: "php/table.zsm.php"

to

ajax: {
url: "php/table.zsm.php",
type: "GET",
data: {
portfolio: getQueryVariable("port"),
year: getQueryVariable("yr"),
type: getQueryVariable("ty")
}}

I noticed the parameter's above are being passed and added after the edit parameter when the edit request is trying to be performed.

How can I prevent this?

TypeError: data is undefined

$
0
0

Hi, I have this error: TypeError: data is undefined
this is my javascript code:

$(document).ready(function()
{
    var tabla = $('#LosUsuarios').dataTable(
    {
        "processing": true,
            "serverSide": true,
        "ajax":
        {
            "url": "listadoUsuarios.php",
            "type": "POST"
        },
        "columns": [
            { "Usuarios": "Nombres" },
            { "Usuarios": "Apellidos" },
            { "Usuarios": "Usuario" },
            { "Usuarios": "Email" },
            { "Usuarios": "Rol" }
        ]
    });
 });

My json result is:

{"Usuarios":[{"Nombres":"Manuel Lisandro","Apellidos":"Dardón López","Usuario":"mldgato","Email":"manueldardon@hotmail.com","Rol":"1"},{"Nombres":"Luisa María","Apellidos":"Pérez Rodríguez","Usuario":"lperez","Email":"lperez@manueldardon.net","Rol":"2"},{"Nombres":"Walter Antonio","Apellidos":"Ceballos Carranza","Usuario":"wceballos","Email":"wceballos@manueldardon.net","Rol":"3"},{"Nombres":"Cesar Sebastían","Apellidos":"Domínguez Contreras","Usuario":"cdominguez","Email":"cdominguez@gmail.com","Rol":"3"},{"Nombres":"Maria Silvia","Apellidos":"Estrada Morales","Usuario":"mestrada","Email":"mestrada@gmail.com","Rol":"3"}]}

you can see in:

sigeco.manueldardon.net/usuarios/listadoUsuarios.php

I followed the following example:
https://datatables.net/examples/server_side/post.html

But it does not work, someone can guide me please

MYSQL FAIL TO CONNECT TO DATATABLE EDITOR

$
0
0

hi and thank you for this lovely plugin

i downloaded editor datatable and i wan to run it in my wampserver
so here is what ive done so far :smile:

$sql_details = array(
"type" => "Mysql", // Database type: "Mysql", "Postgres", "Sqlite" or "Sqlserver"
"user" => "root", // Database user name
"pass" => "", // Database password
"host" => "localhost", // Database host
"port" => "80", // Database connection port (can be left empty for default)
"db" => "test", // Database name
"dsn" => "" // PHP DSN extra information. Set as charset=utf8 if you are using MySQL
);
- after that i used this link "https://editor.datatables.net/examples/sql/mysql.sql" to fetch data to my database "test"

but i got this
{"sError":"An error occurred while connecting to the database 'test'. The error reported by the server was: SQLSTATE[HY000] [2006] MySQL server has gone away"}

do i miss something ??

and thanks

DATATABLE LOST RESPONSIVE AFTER AJAX REFRESH

$
0
0

hi everyone

So i'm using responsive.datatables library to manage my mysql-php data into it

i have a rental car backend and i wan to manage my cars inside datatable (image_1)

so when i do Add car or edit car it redirect me to another div which contain requested action

after adding or editing when i make a return back to datatable cars list

i lost responsive (image_2) and i cant recover it only if i refresh page or resizing navigator window ?

any suggestions ?


I have a checkbox in the first column and would like to filter based if checked or not checked

$
0
0

I was trying something like oTable.columns( 0 ).search(true).draw();

I have a check box on top of the table where i can show only rows with checked checkboxes.. but its a mes with the filtering and the pagination.. what the best method???

Change DataTable after initialization by Bootstarp

$
0
0

How can I change the default initialization that is automatically generated by bootstrap ?

I want to add this :
"paging": false

var table = $('#datatable-responsive').DataTable({
"dom": '<"top"lfp>rt<"bottom"ip><"clear">',
"columnDefs": [ {
"targets": 'no-sort',
"orderable": false
} ],
"order": [[ 1, "asc" ]],
"pageLength": 200,
"lengthMenu": [[10, 25, 50, 100, 150, 200, 500, -1], [10, 25, 50, 100, 150, 200, 500, "All"]]

    });

Excel report select = true use for checkbox instead shift key?

$
0
0

I am working on datatable excel export and able to fetch only selected reports in report with the help of selection of records with Shift key.

However, can we use checkbox instead shift key to select records manually which are needed in report ?

Please advice

csvHtml5 Export adding ‌

$
0
0

I am populating data for columns using mData and I need to provide export options CSV and Excel. I had an issue where leading zeros were getting deleted for both. I found a solution for this which works great for Excel but for CSV it is adding ‌ for all the columns which are defined in ColumnDefs. Here is the code snippet of how I have defined datatables and rendering data. I am using DataTables 1.10.9 version.

$('#datatable_inbond')
            .dataTable(
                    {
                        "sDom" : "<'dt-toolbar'<'col-xs-12 col-sm-6'l><'col-sm-6 col-xs-6 hidden-xs'B>r>"
                            + "t"
                            + "<'dt-toolbar-footer'<'col-sm-6 col-xs-12 hidden-xs'i><'col-sm-6 col-xs-12'p>>",//dom settings: l=length changing input control(Records per page); T=to enable TableTools; B=Button for Datatable 1.10.9
                            buttons: [{
                                extend : 'colvis',
                                text : '<fmt:message bundle="${msg}" key="DT_oColVisShowHide"/>'        
                             },
                             {
                                extend : 'csvHtml5',
                                text : '<fmt:message bundle="${msg}" key="csv_txt"/>',
                                exportOptions : {  orthogonal : 'sort'}
                                
                                             
                            },{
                                extend : 'excelHtml5',
                                text : '<fmt:message bundle="${msg}" key="excel_txt"/>',
                                exportOptions : { orthogonal : 'sort'}
                                              
                             }],                             
                            "paging":   true,  // Table pagination
                             "ordering": true,  // Column ordering 
                             "info":     true,  // Bottom left status text
                             "destroy": true,
                             sAjaxSource : "/aceinbond/aceInbondPage/getDataTable", //url for ajax; used as sSource in the ajax call below
                             "fnServerData" : function(sSource, aoData, fnCallback) { //sSource:ajax url; aoData: parameters to POST; fnCallback: function to execute on success
                                         if (btnClick == true) {
                                                //execute ajax call only if btnClick flag is set to true
                                                    aoData.push({"name" : "userId","value" : '${context.userId}'});
                                                    aoData.push({"name" : "authToken","value" : '${context.token}'});
                                                    aoData.push({"name" : "LocationType","value" : LocationType});
                                                    aoData.push({"name" : "Site", "value" : site});
                                                    aoData.push({"name" : "BeginDate","value" : beginDate});
                                                    aoData.push({"name" : "EndDate","value" : endDate});
                                                    aoData.push({"name" : "MovementType","value" : movementType});
                                                    aoData.push({"name" : "ErrorCode","value" : errorCode});
                                                                                                        
                                                    $.ajax({
                                                            "dataType" : 'json',
                                                            "type" : "POST",
                                                            "url" : sSource,
                                                            "data" : aoData,
                                                            "cache" : true,
                                                            "success" : function(tableData) {
                                                                if (tableData.statusCode != "undefined" && tableData.statusCode != "0000") {
                                                                    $("#errorBlock").text("<fmt:message bundle="${msg}" key="InbondError.DataRetvError" />"+ tableData.statusCode);
                                                                    $("#errorBlock").show();
                                                                    $.unblockUI();
                                                                } else {
                                                                    fnCallback(tableData); // draw the table on success 
                                                                    $("headerData").show();
                                                                }
                                                                
                                                                recCount = tableData.aaData.length; //get number of records in the table
                                                                if (recCount < 1) { //Error handling for Empty table
                                                                    $("#errorBlock").text("<fmt:message bundle="${msg}" key="InbondError.NoData" />");
                                                                    $("#errorBlock").show();
                                                                }
                                                            },
                                                            "error" : function(jqXHR,textStatus,errorThrown) {
                                                                // Will enter here whenever the server does not respond with a http status in 200 range.
                                                                // example 404, 500, .......
                                                                // Will also enter here when datatables fails to create the request 
                                                                if (textStatus == "parsererror") {
                                                                    if ($('#errorBlock').show() == true) {
    
                                                                    } else {
                                                                        $("#errorBlock").text("<fmt:message bundle="${msg}" key="InbondError.SystemError" />");
                                                                    }       
                                                                } else {
                                                                    if ($('#errorBlock').show() == true) {
    
                                                                    } else {
                                                                        $("#errorBlock").text("<fmt:message bundle="${msg}" key="InbondError.HTTPError" />"+ jqXHR.status+ ":  "+ textStatus);
                                                                    }
                                                                }
                                                                $("#errorBlock").show();
                                                                $.unblockUI();
                                                            }
                                                        });
                                                    
                                                 btnClick = false;
                                             }else{
                                                 var initialData=null;
                                                 initialData = {aaData:[], iTotalDisplayRecords:0, iTotalRecords:0, sColumns:null, sEcho:null, statusCode:"0000"};
                                                 fnCallback(initialData); // draw the table
                                             } 
                                        },
                                        aoColumns : [ //DataTable column definitions in order of display
                                                        {"mData" : "carrierCode"}, //0
                                                        {"mData" : "flight"}, //1
                                                        {"mData" : "arrivalDate"}, //2
                                                        {"mData" : "mawb"}, //3
                                                        {"mData" : "shipment"}, //4
                                                        {"mData" : "packageID"}, //5
                                                        {"mData" : "fpoaSite"}, //6
                                                        {"mData" : "bondNumber"}, //7
                                                        {"mData" : "bdsAirport"},//8
                                                        {"mData" : "ogzNumber"}, //9
                                                        {"mData" : "errorCode"}//10
                                                    ],columnDefs: [{
                                                        targets:[1,3,4,6,7,9,10],
                                                        render: function(data, type, row, meta){
                                                           if(type === 'sort'){
                                                               return "\u200C" + data ; //force to keep leading zeros.
                                                           }
                                                           
                                                           return data ;  
                                                            
                                                        }
                                                     }],                                                    
                                        "preDrawCallback" : function() {
                                            if (btnClick == true) {
                                                $("#wid-id-1").hide();
                                                $.blockUI(); // START BLOCK UI
                                            }
                                            // INITIALIZE THE RESPONSIVE DATATABLES HELPER ONCE.
                                            if (!responsiveHelper_datatable_col_reorder) {
                                                responsiveHelper_datatable_col_reorder = new ResponsiveDatatablesHelper(
                                                        $('#datatable_inbond'),
                                                        breakpointDefinition);
                                            }
                                        },
                                        "rowCallback" : function(nRow,aData) {
                                            responsiveHelper_datatable_col_reorder.createExpandIcon(nRow);
                                            return nRow;
                                        },
                                        "fnDrawCallback": function( oSettings ) {
                                            // END BLOCK UI
                                            $.unblockUI();
                                            // SHOW WIDGET GRID
                                            $("#wid-id-1").show();
                                            },
                                        "fnInitComplete" : function(oSettings, json) {
                                            // END BLOCK UI
                                            $.unblockUI();
                                            // SHOW WIDGET GRID
                                            $("#wid-id-1").show();
                                        },
                             "oLanguage" : { //Language used in the DataTable
                                    "sEmptyTable" : "<fmt:message bundle="${msg}" key="DT_emptytable" />",
                                    "sInfo" : "<fmt:message bundle="${msg}" key="DT_sInfo" />",
                                    "sInfoEmpty" : "<fmt:message bundle="${msg}" key="DT_sInfoEmpty" />",
                                    "sLoadingRecords" : "<fmt:message bundle="${msg}" key="DT_sLoadingRecords" />",
                                    "sZeroRecords" : "<fmt:message bundle="${msg}" key="DT_sZeroRecords" />",
                                    "sProcessing" : "<fmt:message bundle="${msg}" key="DT_sProcessing" />",
                                    "oPaginate" : {
                                        "sNext" : "<fmt:message bundle="${msg}" key="DT_sNext" />",
                                        "sPrevious" : "<fmt:message bundle="${msg}" key="DT_sPrevious"/>"
                                    }
                                },
                                "oColVis" : {
                                    "buttonText" : "<fmt:message bundle="${msg}" key="DT_oColVisShowHide" />"
                                }
                    }); //DataTable Code ends   

Is it possible to use DataTables's ajax in ASP.NET Webforms?

$
0
0

As you might know, ASP.NET gives ajax response with d parameter. I tried to alter this with:

dataSrc: function (json) {
                    return json.d.data;
                }

But when I run it, it shows jquery.dataTables.js:4108 Uncaught TypeError: Cannot read property 'length' of undefined(…). As you can see on the image I attached within this post. I checked in that part and it seems like dataSrc doesn't really alter all the response.

this what I did for the DataTables's ajax option:

dataTable: {
    ajax: {
        type: 'POST',
        url: window.location.href + '/GetData',
        contentType: 'application/json; charset=utf-8',
        dataType: 'json',
        dataSrc: function (json) {
            return json.d.data;
        },
        ..... //other options
}

So, I just want to make sure. Is it possible to use DataTable's ajax in Webforms regarding this response matter? If yes, is there any other option to alter all the responses that will be handled by DataTables?

Why is my datatable gone when I refresh my data after I have changed the language

$
0
0

The situation: I have a datatable created with datatable="ng" and dt-options

           <table id="ioRelationTable" datatable="ng" class="table hover" dt-options="vm.dtOptions" dt-column-defs="vm.dtColumnDefs">
                <thead>
                <tr>
                    <th>{{ "COL1" | translate }}</th>
                    <th>{{ "COL2" | translate }}</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="rel in vm.datalist">
                    <td>{{ rel.col1 }}</td>
                    <td>{{ rel.col2 }}</td>
                </tr>
                </tbody>
            </table>

In the dt-options I have defined the language as a reference to a json file:

           vm.dtOptions = DTOptionsBuilder
                .newOptions()
                .withDOM('<"pull-right l-ml-1"B>lftrip')
                .withPaginationType('simple_numbers')
                .withDisplayLength(25)
                .withLanguageSource('i18n/dt_' + $rootScope.language.id + '.json')
                .withButtons([
                    'csv',
                    'excel'
                ]);

            vm.dtColumnDefs = [
                DTColumnDefBuilder.newColumnDef(0),
                DTColumnDefBuilder.newColumnDef(1).notSortable()
            ];

When I change the language in my rootscope the labels gets translated. But if I change the vm.datalist after this the whole table is gone. Why? When i dont use the datatable directive the table gets renderend

ServerSide Post Data MSSQL with ODBC13 System DSN

$
0
0

Hello All,

i'm using ServerSide Post Data and i would like to use the SYSTEM DSN with ODBC13 driver!

Now i'm using this as sql_details

// SQL server connection information
$sql_details = array(
    'user' => '',
    'pass' => '',
    'db'   => '',
    'host' => ''
);

in the PDO-Connection String it should be looking like this
new PDO ( "odbc:<DSN_Name>", 'user', 'pass')

How can i set the DSN in the sql_details that the PDO-Connection and the rest in ssp.class.php will work?


Editor: Accessing MJoin Columns

$
0
0

I am using an MJoin to grab the last "time" record for an employee that has logged in to they system. The login/logout work fine, but I need to check to see if the employee is logged in/out, which is not working.

JSON snippet (MJoin returned):

"logan_dvpr_timeLog":[{"logan_dvpr_timeLog":{"taskID":"1462","userID":"38","loggedINYN":"Y","timeOUT":null,"timeIN":"11/5/2016"}}]}

JS snippet:

var table = $('#ProductionData').DataTable( {
        ajax: './api/DVPRTaskData/DVPRTaskData/' + dvprID,
        order: [1, 'asc'],
        fixedHeader: true,
            columns: [            
            {
                "data": "logan_dvprTasks.taskID", "visible": false, "targets": 1
            },
            {
                "data": "logan_dvpr_timeLog[0].loggedINYN", "visible": true
            }
            ] ...

I am trying to access the first value of loggedINYN from MJoined table logan_dvpr_timeLog. Any ideas?

Editor: Bubble and Inline Together in Same Row

$
0
0

This chunk of code was working previously, and now it's not...not sure what I did. I have a combo of inline editing and bubble editing for each row. Some columns are not editable, others are inline, and one is a bubble with two fields to edit.

JS:


var editor; $(document).ready(function() { editor = new $.fn.dataTable.Editor( { ajax: "./api/mytime", table: "#ProductionData", fixedHeader: true, fields: [ { "label": "Task Name:", "name": "logan_dvprTasks.taskNumber", "type": "select" }, { "label": "Misc. Task Name/Desc:", "name": "logan_dvprTasks.miscTaskName" }, { "label": "Task Time In:", "name": "logan_dvpr_timeLog.timein", "type": "datetime", "def": function () { return new Date(); }, format: 'MM-DD-YYYY h:mm A' }, { "label": "Task Time Out:", "name": "logan_dvpr_timeLog.timeout", "type": "datetime", "def": function () { return new Date(); }, format: 'MM-DD-YYYY h:mm A' }, { "label": "Time Notes:", "name": "logan_dvpr_timeLog.timeNotes", "type": "textarea" } ], formOptions: { inline: { onBlur: 'submit' } } }); $('#ProductionData').on('click', 'tbody td:nth-child(4)', function (e) { editor.bubble(this); }); $('#ProductionData').on('click', 'tbody td:not(:first-child):not(:nth-child(1)):not(:nth-child(2)):not(:nth-child(3)):not(:nth-child(4)):not(:nth-child(8))', function (e) { editor.inline(this, { onBlur: 'submit' }); }); var table = $('#ProductionData').DataTable( { ajax: './api/mytime', order: [6, 'desc'], fixedHeader: true, columns: [ { "data": null, "defaultContent": "", "orderable": false, "className": "select-checkbox" }, { "data": "logan_dvpr.jobNumber" }, { "data": "logan_dvpr.dvprNumber" }, { "data": "logan_dvpr.customerDesc" }, { "data": null, "render": function (data, type, row) { var misc = ""; if (data.logan_dvprTasks.miscTaskName != null) misc = data.logan_dvprTasks.miscTaskName; return data.logan_dvprTasks.taskName + '&nbsp;' + misc; }, "editField": ["logan_dvprTasks.taskNumber", "logan_dvprTasks.miscTaskName"], "className": "noneditable" }, { "data": "logan_dvpr_timeLog.timein", "className": "editable", "editField": "logan_dvpr_timeLog.timein" }, { "data": "logan_dvpr_timeLog.timeout", "className": "editable", "editField": "logan_dvpr_timeLog.timeout" }, { "data": function (data, type, row) { // Calculate the difference between the two dates return datediff('h', data.logan_dvpr_timeLog.timein,data.logan_dvpr_timeLog.timeout) }, }, { "data": "logan_dvpr_timeLog.timeNotes", "className": "editable", "editField": "logan_dvpr_timeLog.timeNotes" } ], select: { style: 'os', selector: 'td:first-child' }, lengthChange: true, lengthMenu: [[10, 25, 50, 75, -1], [10, 25, 50, 75, "All"]], pageLength: 50 }); new $.fn.dataTable.Buttons(table, [ { extend: "create", text: "Add Missing Time Record", editor: editor, formButtons: [ 'Save', { label: 'Cancel', fn: function () { this.close(); } } ] }, { extend: "edit", editor: editor, formButtons: [ 'Save', { label: 'Cancel', fn: function () { this.close(); } } ] }, { extend: "remove", editor: editor, formMessage: function (e, dt) { return 'Are you sure you want to delete this record?'; }, formButtons: [ 'Delete', { label: 'Cancel', fn: function () { this.close(); } } ] }, { extend: 'collection', text: 'Export', buttons: [ 'copy', 'excel', 'csv', 'pdf', 'print' ] } ]); table.buttons().container() .prependTo($('div.fg-toolbar:eq(0)', table.table().container())); });

I am getting the error: uncaught exception: Cannot edit more than one field inline at a time on the field that has the two editable fields in the bubble. I have specified that this field is to be a bubble, and disabled it from the inline editing, but it's still trying to inline edit. What am I doing wrong?

Customised ajax staff.php et upload.php

$
0
0

Hello,

I can not insert a picture in the file "staff.php"...
When I took the "upload.php" file here's what's inside:

$(document).ready(function() {
    editor = new $.fn.dataTable.Editor( {
        ajax: "../php/upload.php",
        table: "#example",

whereas in the file "staff.php", there follows:

$(document).ready(function() {
    editor = new $.fn.dataTable.Editor( {
        ajax: "../php/staff.php",
        table: "#example",

I wish I could insert an image file using the "staff.php" ...

if you have an idea, thank you in advance

what is staff.php?

Can i make function to reload datatable

$
0
0

Hi, I'm new

I make some program with datatable,
When i want try to input data, after process insert data automatically reload table
Here is my example code :

function dataTableCall(NameData){
if(NameData == "kategori"){
var table = $('#table_control').DataTable({
"ajax": BaseURLBack() + '/data/table_' + NameData + '.php?NAMEDATA=' + NameData,
"paging": true,
"lengthChange": false,
"searching": true,
"ordering": true,
"info": false,
"autoWidth": true,
"columnDefs": [
{
"targets": -1,
"data": null,
"render": function ( data, type, full, meta ) {
var FirstButton = '<a href=\'' + data[ 2 ] + '\' class=\'btn btn-info btn-sm ripple-effect\' style=\'margin-bottom:5px;\' data-toggle=\'modal\' data-target=\'#EditModal\'><i class=\'fa fa-pencil\'></i>  Edit</a>';
var SecondButton = '<a href=\'' + data[ 3 ] + '\' class=\'btn btn-danger btn-sm ripple-effect\' style=\'margin-bottom:5px;\' data-toggle=\'modal\' data-target=\'#DeleteModal\'><i class=\'fa fa-pencil\'></i>  Hapus</a>';
return FirstButton + ' ' + SecondButton;
}
}
],
"language": {
"processing": "

"
},
"processing": true
});
}
}

function ReloadDataTable(){
table.ajax.reload();
}

i try to calling ReloadDataTable() , but function not work.
How to fix this ?
Thanks

Viewing all 35413 articles
Browse latest View live