Premium support for our pure JavaScript UI components


Post by MauriceLapre »

Hi,

I'm running into something. When you have a Combo that can be emptied, when you empty it the project does not see that change in crudStoreHasChanges(). It's returning false. Therefore, my save function won't go off. Happens in my app on 4.1.0, but also on your TaskEditor demo (attached code based on that).

Please have a look at this. Thank you!

Kind regards,

Maurice

Attachments
app.module.js
(5.23 KiB) Downloaded 71 times

Post by saki »

Color Combo change event is fired too early. Try to listen to select event.

Note: If you need a processing after the project is changed, it is best to listen to a data-level event, such as https://bryntum.com/docs/gantt/#Gantt/model/ProjectModel#event-hasChanges and do not rely on UI changes.


Post by MauriceLapre »

Hi,

The listening on the combo is not the point, emptying the combo does not show as a change on the project. I've got this code, which is triggered by a save button click on a toolbar to save all changes to the backend:

onSaveClick() {
        const projectHasChanges = this.gantt.project.crudStoreHasChanges();
        console.log(projectHasChanges);

    if (projectHasChanges) {            
        backendTools.onSaveClick();    

    }
    else {
        Toast.show(gantt.L('No changes to save yet...'));
    }
    
}

After emptying the combo (when is had a value of course), gantt.project.crudStoreHasChanges() should return true but it returns false.


Post by saki »

I see. I have tried to reproduce it with our on-line taskeditor demo: https://bryntum.com/examples/gantt/taskeditor/ and it seems that there must be something different.This is what I've got:

project-changes.gif
project-changes.gif (1.17 MiB) Viewed 702 times

Is there any additional step needed?

Ideally, post please a showcase that we would run, investigate and debug.


Post by MauriceLapre »

Well that looks quite like my situation. I'll have a new look at both, because in my situation it returns false.


Post by MauriceLapre »

Hi,
I couldn't discover what exactly was going on, but after adding nullable: false and nullValue: '' to the combo, the change (clear event on combo) was detected. It's setting the value to '' instead of null, and that's even better in my case.

Issue solved. Thank you!


Post Reply