-
Notifications
You must be signed in to change notification settings - Fork 167
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
Google DataTable requires label (not id) to be set to "group" #35
Comments
Hi, Actually, as an user, I consider this as a feature, that I do use a lot : So, for my part, I'm using unspecific column ids when creating my tables, and then, I set the labels according to what I want to show. And I really like the way CHAP is using Labels and not IDs 😉 |
Fair enough, but it's quite unintuitive (took me ~30 mins to figure out) when the following works for Start, End and Content, but not Group:
I'd suggest either changing the other columns to work the same way (use label, rather than ID), or fall back to id if label is not specified. It should at least be mentioned in the documentation. |
… label or id, and the first three columns can have any order now. More robust and flexible.
Thanks Crashthatch, good point. Originally the columns where hard coded (start=0, end=1, content=2, optional group=3), but that changed recently by introducing a second optional column, className. I have made the usage of columns more flexible now:
I see you generate your DataTable from php. Note that unless you use some specific functionality offered by Google DataTable (client side querying, sorting, filtering), or read your data from a Google SpreadSheet, it may be faster and easier use plain JSON instead of Google DataTable. |
At the moment, if you create a google.visualization.DataTable with columns with ids "start", "end", "content" and "group", the group column is ignored. Setting the LABEL (not ID) of the group column to "group" fixes the problem and groups are shown.
I traced the problem to timeline.js, line 266, the findColumnId function should be using dataTable.getColumnId(i) rather than dataTable.getColumnLabel(i). Or possibly both should be checked?
The text was updated successfully, but these errors were encountered: