Page 2 of 2

Re: [ANGULAR] Manually modify dropdown items

Posted: Mon Jan 30, 2023 10:19 am
by shimnx

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


Re: [ANGULAR] Manually modify dropdown items

Posted: Mon Jan 30, 2023 11:22 am
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.


Re: [ANGULAR] Manually modify dropdown items

Posted: Tue Jan 31, 2023 3:14 am
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


Re: [ANGULAR] Manually modify dropdown items

Posted: Tue Jan 31, 2023 4:26 am
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.


Re: [ANGULAR] Manually modify dropdown items

Posted: Tue Feb 07, 2023 7:29 am
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


Re: [ANGULAR] Manually modify dropdown items

Posted: Tue Feb 07, 2023 8:41 am
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.


Re: [ANGULAR] Manually modify dropdown items

Posted: Tue Feb 07, 2023 9:42 am
by shimnx

That's my example. Thank you


Re: [ANGULAR] Manually modify dropdown items

Posted: Tue Feb 07, 2023 2:02 pm
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 = '';
        }