{string}:name, with colon(s) in {string}?
{string}:name, with colon(s) in {string}?

Hi,
I am using Datatables 1.10.19 and I have some troubles with column names containing a colon character (":").
It is using "getActiveTable().column(name + ':name')"; but if "name" already contains a ":" it throws an exception.
Reading the documentation (https://datatables.net/reference/type/column-selector, {string}:name) gives me no hint on what to do if the column name already contains a colon character.
The column names are generated from customer tables, so I have no influence on how they are spelled.
I have tried to prefix any ":" with one or more "\" characters, but to no avail.
Any hint?
Thanks,
steinbohrer
Answers
Hi @steinbohrer ,
I suspect that colons are reserved characters so I'm not surprised you'd see problems when using them. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Likely you are getting this error:
As shown in this example:
http://live.datatables.net/katazuru/1/edit
Escaping with
\\
or jQuery.escapeSelector() causes other errors. Although a bit of a pain my suggestion would be to create a function the replaces:
with something else and call it when creating thecolumns.name
and anytime you want to use the{string}:name
selector.Kevin