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

configuring required gesture to select an item #846

Closed
gerpres opened this issue Feb 18, 2014 · 5 comments
Closed

configuring required gesture to select an item #846

gerpres opened this issue Feb 18, 2014 · 5 comments

Comments

@gerpres
Copy link

gerpres commented Feb 18, 2014

I'm using dgrid in a mobile environment with an 'onClick'-action on the rows.
I also want to use the 'selection' feature.

since both use the 'tap' gesture, this doesn't work well.
I would suggest:
-) to use dojox/gesture/tap instead of dgrid-touch-util
-) use an grid-local event variable to hold the required gesture for selection-events (mobileSelectionEvent)

one may then be able to use the 'tap'-gesture for showing details and the 'tap-hold' gesture for selection (android-like)

I could provide a patch if you want

@kfranqueiro
Copy link
Member

dgrid/Selection actually exposes the events that it listens to for triggering selection logic, in the selectionEvents property. Would overriding this allow you to do what you want?

dgrid doesn't rely on anything in dojox by default, in order to avoid requiring developers to include the entire package in builds, which significantly prolongs build time.

@gerpres
Copy link
Author

gerpres commented Feb 26, 2014

I don't think so.
IMO the selectionEvents are ignored for mobile devices.
touch-hold/tap-hold are no native js-events one can listen for - dojox.gestures.tap() defines timeouts etc. to enable these events

@kfranqueiro
Copy link
Member

That's a good point... sorry I responded off-the-cuff, clearly you are correct that right now selectionEvents is completely ignored for touch input. I have a feeling we can probably do something about that so that selectionEvents can be overridden for touch as well (and it should be possible to pass it an extension event), but first I want to review and test #844.

@kfranqueiro
Copy link
Member

While I was looking at another touch-related issue for Selection, I took a whack at making what you want to do feasible as well, in commit 69134ab (this is on a branch, not in master yet). With that changeset, you should be able to customize selectionTouchEvents to listen for tap-hold. Can you give that a shot and let me know how it fares?

(Note that this changeset also hooks up the usual mouse/keyboard event listeners on touch devices as well, to account for touch+mouse devices.)

@kfranqueiro
Copy link
Member

I've tested this for myself with the aforementioned commit (now in master as fd95bfb). Setting selectionTouchEvents to tap.hold from dojox/gesture/tap behaves as expected.

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