javascript - How to change the pagination number format of datatables to another locale? -


how change pagination number format of databales locale format, i.e. arabic number format. have read datatables manual(https://www.datatables.net/examples/basic_init/language.html) , mdn(https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/numberformat) failed find solution.

you have 2 choices (as far can tell) :

  1. alter code, internal function pagebutton added datatable.ext.renderer line 14205 (v 1.10.7)

    $.extend( true, datatable.ext.renderer, {     pagebutton: { 

    change code line 14258 from

    default:     btndisplay = button + 1;     btnclass = page === button ?     classes.spagebuttonactive : '';     break; 

    to

    default:     btndisplay = new intl.numberformat('ar-eg').format(button + 1);     btnclass = page === button ?     classes.spagebuttonactive : '';     break; 
  2. replace rendered content upon draw.dt event

    $('#example').on('draw.dt', function() {    $('.paginate_button').not('.previous, .next').each(function(i, a) {       var val = $(a).text();       val = new intl.numberformat('ar-eg').format(val);       $(a).text(val);    }) });   

    guess pagination should this

    enter image description here

    demo -> http://jsfiddle.net/hojpyahy/


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -