Search code examples
jqueryangularjsangular-datatables

Angular js Datatables footer add links


I want to add links in the footer part of the Datatable where pagination details comes i.e. I want to add the links in between of 'showing 1 of 20 entries in 40' and the pagination's pre next buttons.How can this be done? Any Suggestions??


Solution

  • You need to add it to left side or right side of your footer table, i added to left side where it shows Showing page _PAGE_ of _PAGES_

    jQuery:

    $(document).ready( function() {
        $('#example').dataTable( {
        "language": {
        "info": "Showing page _PAGE_ of _PAGES_ <a href='http://www.example.com'>Link1</a>"
        }
      });
    });
    

    Using angular-datatable, again the way you specify the options will change based on the table you defined and angular version Angular1 option and Angular2 option

    $scope.dtOptions = DTOptionsBuilder.newOptions().withLanguage(
    "sInfo":"Showing page _PAGE_ of _PAGES_ <a href='http://www.example.com'>Link1</a>",
    );