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

Update list of GridStack actions #60

Open
kevinhinterlong opened this issue Mar 4, 2020 · 6 comments
Open

Update list of GridStack actions #60

kevinhinterlong opened this issue Mar 4, 2020 · 6 comments

Comments

@kevinhinterlong
Copy link
Member

Discussion from 065d92d#r37636891

check the events - there is more including gsResizeStop which is better than regular.

Here is a list of events

@kevinhinterlong
Copy link
Member Author

@adumesny Does GridStack have a list of these events anywhere in the code or should we just update our own list?

@adumesny
Copy link

adumesny commented Mar 4, 2020

there is a type (which is enforced with Typescript version) but not an array of them.

type GridStackEvent = 'added' | 'change' | 'disable' | 'dragstart' | 'dragstop' | 'dropped' |
'enable' | 'removed' | 'resize' | 'resizestart' | 'gsresizestop' | string;

I added string (anything) as you can combine them into a space separated list (not sure how to do enforce that type option) as of 1.1.0 (which jquery supported). I update the demos to use it.

https://github.com/gridstack/gridstack.js/blob/develop/src/gridstack.d.ts

Note: master is unfortunately not always latest published... I try to keep it up when releasing but develop is it.

@adumesny
Copy link

adumesny commented Mar 4, 2020

but maybe I should expose an array of them for others to use ? I don't expect those to change often. column might be a new one later (no easy way of knowing when oneColumnMode triggers for example).

@kevinhinterlong
Copy link
Member Author

I don't expect those to change often.

This is what I assumed, so maybe we'll just update this repo's list of events and have to be more careful in the future updates.

Or if you do add a list of events we could use that and you could add them as an assert to runtime typecheck on the space separated list

@jkusa
Copy link
Member

jkusa commented Mar 4, 2020

@adumesny out of curiosity, from a gridstack client perspective, is there a need for both resizestop & gsresizestop?

@adumesny
Copy link

adumesny commented Mar 4, 2020

https://github.com/gridstack/gridstack.js/tree/develop/doc#gsresizestopevent-ui
Note: this is a custom event name that is guaranteed to be called after the jqueryui resizestop event where we update data-gs-width and data-gs-height.
You could instead use the change event which has the latest node sizing.

so only if you care about those fields being set. Personally I use the node values...

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