Thank you tasnim
If the text corresponding to an id changes, how do I update the interface in real time
Support Forum
Hi shimnx,
I am not sure about your case and on what moment you need to change data, but you can manipulate with items
of the combo or https://bryntum.com/products/gantt/docs/api/Core/widget/Combo#config-store if you use that way and change records as you do it for any other stores.
You could make it on https://bryntum.com/products/gantt/docs/api/Gantt/feature/CellEdit#event-beforeCellEditStart , just apply actual data for editor before it opened.
All the best,
Alex
During data initialization, the data in the drop-down list is
[{ 'id': '3a072fb1-c39a-128d-03b1-4e99560e081c', 'text': 'Others' }, { 'id': '3a072fb1-c39a-128d-03b1-4e99560e081d', 'text': 'Others1' }]
After clicking the Chnage Group Name button
[{ 'id': '3a072fb1-c39a-128d-03b1-4e99560e081c', 'text': 'Others2' }, { 'id': '3a072fb1-c39a-128d-03b1-4e99560e081d', 'text': 'Others1' }]
The id doesn't change, but the text does, and I want the interface to synchronize with it
- Attachments
-
- 媒体2.mp4
- (2.98 MiB) Downloaded 2 times
Thank you for video, now it's clear what's the problem in.
Cell content automatically reflects to any data change in record's field that you bind to it. Since you didn't change value of record, but only wants the renderer be re-applied, you need to make it manually.
You could try to call https://bryntum.com/products/gantt/docs/api/Gantt/view/Gantt#function-refreshRows
Triggers a render of records to all row elements. Call after changing order, grouping etc to reflect changes visually. Preserves scroll.
All the best,
Alex
Now when I change the text of an option, I refresh it with refreshRows(), but double clicking the cell shows the same text as before
- Attachments
-
- 媒体7.mp4
- (2.1 MiB) Downloaded 1 time
Thank you for the test case, I reproduced that. Here is a ticket https://github.com/bryntum/support/issues/6121
As a workaround, try to clear value for editor in beforeCellEditStart
handler:
beforeCellEditStart({ editorContext }) {
const { record, editor, column } = editorContext;
editor.value = '';
}
All the best,
Alex