Why there is a difference between dataTable() and DataTable()?
Why there is a difference between dataTable() and DataTable()?
LuizHout
Posts: 3Questions: 1Answers: 0
This has confused me, it was no clear that with DataTable() i had acces to functions and variables and w/ dataTable() i had not access to several functions.
There are some issue on my side and both should work w/ no difference? If not, Why make a such delicate difference? Add a parameter, so it make that difference, is much more "visible".
This question has accepted answers - jump to:
This discussion has been closed.
Answers
http://datatables.net/faqs/index
See the second of the "Most Common FAQ's".
Thanks. The behavior was described on faq.
However, it seems odd to create a diference of return type from UpperCase and lowerCase calls.
I should write a blog post about it sometime. Basically
$().dataTable()
was the old style (v1.0+) and does the standard jQuery thing of returning a jQuery object for chaining.$().DataTable()
returns a DataTables API instance - U used a capitalD
as you are creating anew
API instance and a capital for an instance constructor is common programming styling across the majority of languages (albeit not a requirement).I figured that was better than using
$().dataTableApi()
or similar. I might have been wrong :-)Allan
Thanks for the answer man. Legacy purpose. That explains completely. :)
By the way. Your plugin is awesome and solve perfectly all my needs.
I suggest only. Update the examples in your site to use the DataTable(). I saw that several alredy use the uppercase function. But that was when a got stuck. (and of course. missing the faq).
Anyway, thanks for the awesome plugin and for the promptly response.