highcharts / highcharts/controls
Support individual columns update
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
### Actual problem
It is not possible to define a path to update a specific column in the Grid.
Example: https://jsfiddle.net/BlackLabel/zpf7hxr0/
### Why?
Unlike `chart.series` in Core, in `grid.columns` the order has no importance and everything is updated based on `column.id`.
So
```ts
grid.update({
columns: [{
enabled: false
]}
});
```
does not work. It has to be:
```ts
grid.update({
columns: [{
id: 'column_id',
enabled: false
]}
});
```
### Ideas
(A) Technically this could be solved on the Grid side by simply allowing columns to be updated without an `id`, but this would be unintuitive and unstable (often not all columns that are displayed on the Grid are defined in the options).
(B) Alternatively, In path it could be possible to add the option to simply enter the column id instead of the index, and in the background it would be changed to an array with an object with `id` and the specific option:
```html
```
The downside is that it would be ambiguous. The interpretation could be misleading as it is: `columns: { column_id: { ... } }` instead of `columns: [{ id: 'column_id', ... }]`. But this is the simplest solution I could think of at the moment.
(C) Something more explicit but more complicated, like e.g. an additional argument to `highcharts-control`.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the path handling behind highcharts-control and Grid's columns update behavior, using the jsfiddle and grid.update examples as the reproduction. Agree on one of the proposed approaches, then define completion as updating a specific column by its id without ambiguity and covering that behavior with regression tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100