0

I'm trying to set default configurations to be used everytime the datatable plugin is called, but it is not working. The defaults are just ignored.

Example:

$.extend($.fn.dataTableExt.defaults, {
            "sPaginationType": "full_numbers",
        });

        $content.find("table.datatable").dataTable({
            "bServerSide": true,
            "sAjaxSource": '@Url.Action("ListaGrid")'
         });

In the case above, the configuration "sPaginationType" is not applied.

Any tips?

Thank you.

Rodrigo Pires
  • 574
  • 2
  • 11
  • 23

2 Answers2

2

In 1.9.3 you can change defaults like:

$.extend($.fn.dataTable.defaults, {
    oLanguage: {
        "sProcessing": "Loading... please wait."
    }
});

But this only works for the basic settings and not for any extra (plugins).

Plínio César
  • 5,965
  • 3
  • 23
  • 30
0

Figured out that it is not working because I'm using datatables version 1.8.1, which doesn't accept defaults yet.

Anyway, does anybody know how can I declare the default options (i.e. in a variable) and use it as default in every datatables instance??

Thank you!

Rodrigo Pires
  • 574
  • 2
  • 11
  • 23