Our state of the art Gantt chart


Post by shimnx »

Thank you tasnim
If the text corresponding to an id changes, how do I update the interface in real time


Post by alex.l »

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


Post by shimnx »

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 13 times

Post by alex.l »

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


Post by shimnx »

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 17 times

Post by tasnim »

Hello,

I tried to reproduce it with our online basic Gantt demo and it works fine here. Could you please upload a runnable test case so we could debug it? so the assistance will be much faster.


Post by shimnx »

That's my example. Thank you

Attachments
expamle.zip
(391.31 KiB) Downloaded 17 times

Post by alex.l »

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


Post Reply