Documentation for DataTables() constructor
Documentation for DataTables() constructor
creidieki
Posts: 7Questions: 3Answers: 0
Hi, according to https://datatables.net/reference/type/DataTables.Api one of the ways to create a DataTables API object is through the $( selector ).DataTable(); call. But that call isn't listed in the list below, or described anywhere on the page. Where is it documented? For example, what are the parameters of that call? (It's used with parameters on https://datatables.net/examples/basic_init/filter_only.html ).
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
When
$( selector ).DataTable();
is used the first time it will initialize thetable
element(s) matching the selector. Once initialized, the call to$( selector ).DataTable();
returns an instance of the API for that table. Subsequent uses of$( selector ).DataTable();
will retrieve an API instance for that table.The initialization options are documented here under Reference > Options. The API is documented here under Reference > API.
Does this answer your questions?
Kevin
But what are the arguments to the DataTable() method? Is that what you mean by an "initialization option"?
The documentation you linked to has this among other examples and explanations:
@kthorngren has shown you where to find the initialization options which may accompany the initial call. I'm not sure what else you want.
As Kevin said, all of the options are listed under Reference->Options - and anything passed in to that constructor are what we call the initialisation options For example, this here shows how you can render columns and use Ajax to get the data,
Colin
So the DataTable() function takes zero or one parameters. If there's one parameter it should be an object. Any attributes of that object are referred to as "options" in the documentation, and will be interpreted according to the Options section of the documentation?
That's all I was asking about. It seems like that should be stated in the documentation.
Its documented in the Installation Manual Initializing Datatables section:
There is a lot of documentation and its not always easy to find everything After awhile you will get a feel for where to look.
Kevin
Okay, but that kind of information should be in the Reference section too, not just the Manual.