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

Unsetting a store with Grid.set("store", null) is broken in 0.3.9 #688

Closed
kilink opened this issue Aug 1, 2013 · 1 comment
Closed

Unsetting a store with Grid.set("store", null) is broken in 0.3.9 #688

kilink opened this issue Aug 1, 2013 · 1 comment

Comments

@kilink
Copy link

kilink commented Aug 1, 2013

Before 0.3.9, using Grid.set("store" null) worked for disconnecting a store from the Grid (useful when adding/removing lots of objects from the store).

This now fails on https://github.com/SitePen/dgrid/blob/master/_StoreMixin.js#L110 ,
because the code is trying to read the "notify" property of null. This was changed as part of a fix for #677.

I think simply changing that expression to the following will fix the issue:

if (store && typeof store.notify === "function"){

Alternately, if this isn't how one should unset/disconnect a store from a Grid, there doesn't appear to be an API for that. For what it's worth, I seem to recall this being the way to do it with the old dojox grids (calling setStore(null)).

@ghost ghost closed this as completed in d415236 Aug 5, 2013
@kfranqueiro
Copy link
Member

Thanks for reporting this. I tried to be careful to poke for regressions like this before tagging 0.3.9, but looks like I missed one. :)

You're right though, there's not really any better way to disconnect a store, particularly since Observable has no way of pausing observe handlers.

This issue was closed.
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