Hi,
this is possible with a “Custom Command” for the DataTables JavaScript library.
Please try adding this to the “Custom Commands” textfield in the “Datatables JavaScript Features” section on the “Edit” screen of your table:
"sDom: "frtlip"
For more information, please take a look at the DataTables documentation for this topic, at http://datatables.net/usage/options#sDom .
Best wishes,
Tobias
How might one make such an adjustment as the global default?
Hi,
that could be done with a plugin filter hook, which would require some custom PHP code.
Please try pasting the following into the “functions.php” file in your theme folder.
add_filter( 'wp_table_reloaded_js_frontend_parameters', 'wp_table_reloaded_change_sdom', 10, 6 );
function wp_table_reloaded_change_sdom( $parameters, $table_id, $html_id, $script, $js_command, $js_options ) {
$parameters['sDom'] = '"sDom: "frtlip"';
return $parameters;
}
Regards,
Tobias
Tobias,
Thanks for the fast response. I really need to get my head wrapped around the hooks. Seems like it’s a powerful feature I am not taking full advantage of.
This line:
$parameters['sDom'] = '"sDom: "lfpitr"';
Is missing a double quote needs to read like this:
$parameters['sDom'] = '"sDom": "lfpitr"';
Otherwise, it worked great. Thank you for the solution and thank you for the plugin!
Hi,
oh yes, plugin filter hooks are basically the feature in WordPress that make plugins possible in the first place 🙂
And thanks for the hint on the quotation mark! I just copy/pasted my original code from above, without checking it again, argh…
Best wishes,
Tobias