Common Settings for Multiple DataTables
Common Settings for Multiple DataTables
Khushi2005
Posts: 6Questions: 2Answers: 0
Hi,
I am having multiple default settings for various pages. I wanted to have common functions which can be called on tables.
'''
$.extend( true, $.fn.dataTable.defaults, {
"searching"String: false,
"ordering"String: false
} );
$(document).ready(function() {
$('#example'String).DataTable();
} );
'''
Is it possible pass String or call function when you say
$('#example'String).DataTable(call function/string );
Thanks in advance
This discussion has been closed.
Answers
I don't really understand your question I'm afraid. If you want to apply common settings, you would do so using the defaults, which you mention.
Allan
Let's say I have 6 tables and I am attaching similar styles to 3 tables and other styles to remaining.
So instead of writing same code , I wanted to check if I can pass String like
and other styles as
responsive: true
, 'bAutoWidth' : false
,searching : false
,paging : true
Similar to using this function
$.extend( true, $.fn.dataTable.defaults, {}
but instead of fn.dataTable.defaults pass fn.dataTable.(cssClass name or some Selector)
I hope I am able to explain.
What I want to accomplish to avoid rewriting all the default formats for different sets.
The more I am using Datatable more I am enjoying using it.
Thanks for such an awesome plugIn
You could do this:
Allan