Setting defaults
Setting defaults
![PWXCaptCrunch](https://secure.gravatar.com/avatar/5148c67a51211f59d34fa3f1f2490aed/?default=https%3A%2F%2Fvanillicon.com%2F5148c67a51211f59d34fa3f1f2490aed_200.png&rating=g&size=120)
I am trying to set default options for all initializations of data tables across the whole application. I have seen examples using this:
$.extend(true, $.fn.dataTable.defaults, {
"searching": false,
"ordering": false
});
My question is where do I put that JS code?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Here is the docs for this:
https://datatables.net/manual/options#Setting-defaults
Looks like you place that code before you initialize your Datatables.
Kevin
If you have to do it before you initialize your tables it isn't really the global solution I hoped it would be. At that rate I might as well just put the options I want in each initialization. I thought this would create a config file or something so that anywhere I initialized a table in my app would have those options by default.
This option is for a page that has multiple Datatables and default settings are desired. I don't believe it can be used as a global setting tor multiple pages but I might be wrong.
Kevin
That's what I was afraid of thanks for responding though. @kthorngren