Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes "data-graph-yaxis-X-reversed" are not interpreted by the browser if X is an integer #60

Open
tut-tuuut opened this issue Oct 7, 2014 · 1 comment
Labels

Comments

@tut-tuuut
Copy link
Contributor

$table.data('graph-yaxis-'+yAxisNum+'-min') is always null on my browser, even if the attribute data-graph-yaxis-1-min is set on the <table>.
Looks like this "1" between 2 dashes is the problem.

When I look at document.querySelector('table').dataset I get :

DOMStringMap { graphYaxis-1Min: "0", graphType: "line", graphContainerBefore: "1" }

When I look at '$('table').data()` I get :

Object { graphContainerBefore: 1, graphType: "line" }

So jQuery seems to have issues when mapping the dataset to an object.
I suggest using another convention for naming these data-attributes. :)

Browser : Firefox 32.0.3
Jquery : 2.1.1

@agallou agallou added the bug label Nov 1, 2015
agallou added a commit to agallou/jquery-highchartTable-plugin that referenced this issue Nov 15, 2015
`data-graph-yaxis-X-*` attributes doesn't work
on jQuery 2 (but `data-graph-yaxisX-*` work).
`data-graph-yaxis-X-*` works on the master branch
of jQuery.

In order to have a version that work on all
jQury versions we have to support the `data-graph-yaxisX-*`
version that will be the new norm.

To avoid a Backward compatibility break, we need to
support both versions of the attribute.

* Now all `data-graph-yaxis` attributes could be written
with or without a dash before the axis number.
* There is tests on all the attributes, in both versions
* tests are executed on both jQuery 2 and jQuery 1

see issue highchartTable#60
@agallou
Copy link
Member

agallou commented Nov 15, 2015

When #75 will be merged, data-graph-yaxis-X-reversed could also be written data-graph-yaxisX-reversed whatever the version of jQuery used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants