Single selection doesn't work with Memory store #61

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

Projects

None yet

3 participants

@jesus-crysist

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
Contributor

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

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
Contributor

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

@jesus-crysist

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

@SitePenChrisBarrett
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

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