Abou Mohamad

Abou Mohamad

  • 1.9k
  • 52
  • 13.2k

datatable create multiple filter and pagination rows

Sep 20 2019 9:14 AM
i have a problem in datatable when draw the table using jquery from json string,
each time ($tableid).datatable is called a new filter and pagination row is added above the table.
 followin my code used to create the table: 
cshtml code:
<table id="modalAddresstable" class="table table-striped table-bordered table-hover my-4 w-100 modalAddresstable">
                                                @foreach (var address in @client.Address)

                                                            <button type="button" >
                                                            <button type="button">
JQuery Code
this.ajaxAddressSuccess = function (result) {
        if (typeof result !== 'undefined' || result.lenght > 0) {
            var dataTable = [];
            $.each(result, function (index, value) {
                dataTable.push([value["Country"], value["City"], value["Caza"], value["Other"], value["Edit"], value["Delete"]]);
                           "aoColumnDefs": [
                             { "bSortable": false, "aTargets": [4] },
                             { "bSortable": false, "aTargets": [5] }
                           data: dataTable

        else {


Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.