Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on dgrid-cell data change, dirty doesn't get updated #912

Closed
harpreetkhalsagtbit opened this issue Apr 29, 2014 · 2 comments
Closed

on dgrid-cell data change, dirty doesn't get updated #912

harpreetkhalsagtbit opened this issue Apr 29, 2014 · 2 comments

Comments

@harpreetkhalsagtbit
Copy link

@SitePenKenFranqueiro
On changing value of any cell in grid, data-change event is called first but grid.updateDirty is called later on.
It should be like that
First do grid.updateDirty then emit data-change event

grid.on("dgrid-datachange", function(evt){
    console.log(grid.dirty); //
});
@harpreetkhalsagtbit harpreetkhalsagtbit changed the title on dgrid-cell data change and dirty is not updated on dgrid-cell data change, dirty doesn't get updated Apr 29, 2014
@harpreetkhalsagtbit
Copy link
Author

Problem: Emit event then updateDirty
Editor.js

if(on.emit(cellElement, "dgrid-datachange", eventObject)){
    if(grid.updateDirty){
        if(eventObject.idProperty) {
            grid.updateDirty(row.id, eventObject.idProperty, eventObject.origValue);
        }
.
.
.
.

@kfranqueiro
Copy link
Contributor

This is by design. The dgrid-datachange event can be canceled (by calling preventDefault) in order to stop the change from being registered into the dirty map. Unfortunately the trade-off for this ability is that the dirty hash isn't actually updated until after the event has been handled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants