add/change parameter
add/change parameter
I'd like to add parameter to DataTable object.
initially...
[code]
var oTable = jQuery("#table_id").dataTable({
"bServerSide": true,
"bPaginate": false,
}
[/code]
then I'd like to add/change parameter
[code]
"bPaginate": true,
"aaSorting":[[1, "asc" ]],
[/code]
to make object in the below.
[code]
jQuery("#table_id").dataTable({
"bServerSide": true,
"bPaginate": true,
"aaSorting":[[1, "asc" ]],
}
[/code]
What should I do....
Thank everyone in advance!
initially...
[code]
var oTable = jQuery("#table_id").dataTable({
"bServerSide": true,
"bPaginate": false,
}
[/code]
then I'd like to add/change parameter
[code]
"bPaginate": true,
"aaSorting":[[1, "asc" ]],
[/code]
to make object in the below.
[code]
jQuery("#table_id").dataTable({
"bServerSide": true,
"bPaginate": true,
"aaSorting":[[1, "asc" ]],
}
[/code]
What should I do....
Thank everyone in advance!
This discussion has been closed.
Replies
Allan
What I'd like to do was like ...
using kind of perl template which makes basic common options.
in forms, call the template at first.
and then, add sort depned on each form.
perl making common options
[code]
var oTable = jQuery("#table_id").dataTable({
"bServerSide": true,
"bPaginate": true,
}
[/code]
html1
[code]
|
jQuery("#menu").menu({
disabled: false
});
~call perl~
oTable = blah-blah ( "aaSorting":[[1, "asc" ]] );
jQuery("#accordion").accordion({
collapsible: true,
});
|
[/code]
html2
[code]
|
jQuery("#menu").menu({
disabled: false
});
~call perl~
oTable = blah-blah ( "aaSorting":[[2, "asc" ]] );
jQuery("#accordion").accordion({
collapsible: true,
});
|
[/code]
html3
[code]
|
jQuery("#menu").menu({
disabled: false
});
~call perl~
oTable = blah-blah ( "aaSorting":[[3, "asc" ]] );
jQuery("#accordion").accordion({
collapsible: true,
});
|
[/code]
If there is not method/function to add like above exsample, it's OK.
I'll do somehow.
But thank you again, Allan.
1. Set the default as you need - http://datatables.net/release-datatables/examples/advanced_init/defaults.html
2. Create a Javascript object that you add options to, initialising the table only once when it is fully built.
I'd probably go with option 1 myself, assuming there is only 1 table on each page, otherwise option 2.
Allan
I'll try option 1!
And thank you for creating & opening this hyper awesome cool jQuery!