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

Single selection doesn't work with Memory store #61

Closed
jesus-crysist opened this issue Jan 11, 2012 · 6 comments
Closed

Single selection doesn't work with Memory store #61

jesus-crysist opened this issue Jan 11, 2012 · 6 comments

Comments

@jesus-crysist
Copy link

Using simple array and inserting data into the grid with renderArray() method and setting selectionMode to 'single' it behaves like it should (only one row can be selected at the time).
But when switching to dojo's Memory object store ( code ), single row selection is broken.

@kfranqueiro
Copy link
Member

I'm unable to reproduce this in test/Selection.html, even if I set selectionMode: "single" initially in the properties of the gridRowNavigation grid (which uses a store). Single selection mode appears to work fine for me on 0.2.0 and master.

What version of dgrid are you using? Do you see any errors in firebug / dev tools when selecting? Would you be able to either gist or host a complete isolated test page reproducing the issue?

@jesus-crysist
Copy link
Author

I'm using dgrid 0.2.0 and dojo 1.7.1. Web Inspector's and Firebug's consoles don't show any errors.

This is my code. Unfortunately, my server is down so I can't host it now.

@kfranqueiro
Copy link
Member

That tarball seems to be corrupted/incomplete. Can you try packing and uploading it again?

@jesus-crysist
Copy link
Author

Sorry. I checked this one and it's working on my Ubuntu.

@SitePenChrisBarrett
Copy link
Contributor

jesus-crysist, the problem is that you are using: id: +new Date for your row id. Because each row is being created in the same second, all of the row ids are the same.

The id for each row needs to be unique, this is causing selection to fail because it doesn't know which row to unselect after the first.

If you don't have an identifier to use, just use a random number. :)

@jesus-crysist
Copy link
Author

Thanks. When I set store's idProperty it worked like a charm. I should've known not to use Date as IDs. :/

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

3 participants