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

remove callback called before item is removed #6

Open
franck-serot opened this issue Aug 4, 2015 · 1 comment
Open

remove callback called before item is removed #6

franck-serot opened this issue Aug 4, 2015 · 1 comment

Comments

@franck-serot
Copy link

Hi Dragosu,
I built a tree with a menu to add/remove item.
For each change, I dump tree content with method serialize of the acitree API.
I noticed that if I remove an item than the remove callback is called before the item is really removed.
According to the acitree source code, we can see the following scheduling of methods calls :
// just remove the item
this._success(item, options);
this._removeItem(item);
Could you please confirm or infirm the problem ?
If it's confirmed than could you help me to solve it ?
Thank you in advance for your response.
Best regards,
Franck

@dragosu
Copy link
Owner

dragosu commented Aug 4, 2015

Hi, you are right, the element is removed from the DOM after the .success function call. I think there was a reason why I did it this way, hard to tell that I don't remember why :) You can try to remove the element first or, if something goes wrong, detach first then remove in the end. I think it depends on what logic is implemented around aciTree in the success callback ...

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