dandelion / dandelion-datatables

Dandelion component for DataTables
http://dandelion.github.io/components/datatables/
Other
110 stars 49 forks source link

[CLOSED] Table with dash in id is not working #155

Closed tduchateau closed 10 years ago

tduchateau commented 10 years ago

Issue by KonstantinGrigoriev from Wednesday Jun 12, 2013 at 20:29 GMT


<table id="some-table-id" dt:table="true">
...

This will raise an error in browser: Uncaught SyntaxError: Unexpected token -

Problem is that generated variable name contains dash:

var oTable_some-table-id;
var oTable_some-table-id_params = {

Dash naming style convention for identifiers is very common in web-dev, maybe, its better to replace or remove dash during code generation.

tduchateau commented 10 years ago

Comment by tduchateau from Monday Jun 24, 2013 at 13:23 GMT

To be more precise, the chosen id should be processed in order to remove all characters that are incompatible for a Javascript variable.

Thanks for your feeback.

Regards, Thibault