Join the Stack Overflow Community
Stack Overflow is a community of 6.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

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??

share|improve this question
up vote 0 down vote accepted

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>",
); 
share|improve this answer
    
if it helps mark it as accepted, so that others will use this solution – nivas 3 hours ago
    
change <a href='http://www.example.com'>Link1</a> to <button type="button" ng-click='http://www.example.com'>Link1</button> – nivas 3 hours ago
    
on clicking nothing happens.... f12 inspected as...<button class="text-primary" ng-click="selectAll();">Select All Visible</button> – user101295 3 hours ago
    
do you have selectAll function in your current controller. $scope.selectAll = function () {alert("selected")}; add this and alert will be fired when you click on link – nivas 3 hours ago
    
if you want to show links to only some datatable's then follow this: create a directive like app.directive(showLinks, function () {}) and in your html add show-links="true" to dataTable element, then in your directive check attr.showLinks === true then only add those links to sInfo otherwise not. – nivas 3 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.