0

This piece of code is being generated by Jquery datatables plugin and i dont have control on the HTML generated dynamically

<div class="dataTables_paginate paging_bootstrap pagination">
   <ul>
      <li class="prev"><a href="#">← <span class="hidden-480">Previous</span></a></li>
      <li><a href="#">1</a></li>
      <li class="active"><a href="#">2</a></li>
      <li class="next disabled"><a href="#"><span class="hidden-480">Next</span> → </a></li>
   </ul>
</div>

I just want to show prev and next links thats all (I don't want to show the numbers )

I have tried this way

$( document ).ready(function() {


 $('.dataTables_paginate ul').hide();

  $('.dataTables_paginate ul .prev').show();
  $('.dataTables_paginate ul .next').show();
});

This is my fiddle

http://jsfiddle.net/Us8uc/4368/

Could you please tell me how to disable the 1 and 2 links (which is generated dynamically depending on the data present ) ??

Gyrocode.com
  • 57,606
  • 14
  • 150
  • 185
Pawan
  • 31,545
  • 102
  • 256
  • 434
  • In case, you want to _hide_ that info, [this](https://stackoverflow.com/a/57797167/1042705) seems to work – Irf Sep 05 '19 at 00:58

1 Answers1

0

Set pagingType option to simple to show "Previous" and "Next" buttons only.

$('#example').DataTable( {
   "pagingType": "simple"
});

See this jsFiddle for code and demonstration.

Gyrocode.com
  • 57,606
  • 14
  • 150
  • 185