Closed stevenj closed 8 years ago
Hi,
Indeed it looks like this option is quite special in that it requires an object (nested arrays) to be specified in the tag attribute.
Therefore it requires 2 tweaks:
"
and single quotes '
, so that your code looks like option='[[1, "asc"]]'
. This is a requirement for jQuery, see also https://datatables.net/manual/optionsdata-
attributes should also reverse the use of double and single quotes, so that it can accept double quotes in the value of the attribute.I will propose a PR to address it, hopefully it should be accepted.
Otherwise, you can simply edit the syntax.php
file of DataTables plugin, and replace line 57:
$html5_data[] = sprintf('data-%s="%s"', $key, (string) $value);
by:
$html5_data[] = sprintf("data-%s='%s'", $key, str_replace("'", "'", (string) $value));
Hi again,
The plugin is now merged with pull request #9, so it should work by simply updating it through DokuWiki. Thanks to @LotarProject for having accepted the PR.
Please make sure to use the syntax above.
Hope this helps.
I tried to sort a table, by default on the second column, and not the first.
resulted in the datatables elements disappearing from the page. I couldn't work out any syntax which would allow the order option to be set. I am not sure if this is a bug, or just my misunderstanding of the syntax to pass the option.
Doesn't break the table, but also doesn't do achieve the desired outcome.