Adding custom classes to pagination failing

Adding custom classes to pagination failing

jasonsfjasonsf Posts: 6Questions: 0Answers: 0
edited May 2011 in General
I'm trying to use custom classes for pagination. For example, I want to replace the paging button with a class called "button". Here's the code:

[code]
oTable = $("#<%= tblPINs.ClientID %>").dataTable({
"sPaginationType": "full_numbers",
"bSortClasses": false,
"sPageButton": "button"
});
[/code]

When I view source, I still see class="paginate_button" instead of class="button" in the span. This is the same case with all the pagination classes. (sPageButtonActive , sPageFirst , etc.)

Am I doing something wrong above? (This is with DataTables v1.7.6)

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    sPageButton is not an initialisation option, it's just an object parameter of $.fn.dataTableExt.oStdClasses (assuming you are not use jQuery UI theming). So you would do something like:

    [code]
    $.fn.dataTableExt.oStdClasses.sPageButton = "button";
    oTable = $("#<%= tblPINs.ClientID %>").dataTable({
    "sPaginationType": "full_numbers",
    "bSortClasses": false
    });
    [/code]
  • jasonsfjasonsf Posts: 6Questions: 0Answers: 0
    Thank you so much! I knew it had to be something like that but I couldn't find an example of it implemented. Your library is awesome, by the way.

    Jason
This discussion has been closed.