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

Comments

Projects
None yet
3 participants
@jesus-crysist

jesus-crysist commented Jan 11, 2012

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

This comment has been minimized.

Show comment
Hide comment
@kfranqueiro

kfranqueiro Jan 11, 2012

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?

Contributor

kfranqueiro commented Jan 11, 2012

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

This comment has been minimized.

Show comment
Hide comment
@jesus-crysist

jesus-crysist Jan 11, 2012

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.

jesus-crysist commented Jan 11, 2012

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

This comment has been minimized.

Show comment
Hide comment
@kfranqueiro

kfranqueiro Jan 11, 2012

Contributor

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

Contributor

kfranqueiro commented Jan 11, 2012

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

@jesus-crysist

This comment has been minimized.

Show comment
Hide comment
@jesus-crysist

jesus-crysist Jan 11, 2012

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

jesus-crysist commented Jan 11, 2012

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

@SitePenChrisBarrett

This comment has been minimized.

Show comment
Hide comment
@SitePenChrisBarrett

SitePenChrisBarrett Jan 13, 2012

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. :)

Contributor

SitePenChrisBarrett commented Jan 13, 2012

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

This comment has been minimized.

Show comment
Hide comment
@jesus-crysist

jesus-crysist Jan 15, 2012

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

jesus-crysist commented Jan 15, 2012

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