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

Fix setDragDisable for multiple grids #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix setDragDisable for multiple grids #48

wants to merge 1 commit into from

Conversation

crazyjat
Copy link

Change how setDragDisable works to support multiple grids on one page with different drag settings for each grid.

Change how setDragDisable works to support multiple grids on one page with different drag settings for each grid.
Copy link
Contributor

@skrajewski skrajewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @crazyjat,

Thank you for your contribution! I'm glad that someone is willing to improve this plugin :) I have done a review for you. It will be nice if you fix it because it doesn't work as expected.

Kind regards,
Szymon

@@ -145,7 +139,7 @@
},

onDragStartEventListener: function(e) {
if (uiGridDraggableRowsSettings.dragDisabled || (hasHandle && !handle)) {
if (this.dragDisabled || (hasHandle && !handle)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this in this place is DOM node

var publicMethods = {
dragndrop: {
setDragDisabled: function setDragDisabled(status) {
uiGridDraggableRowsSettings.dragDisabled = ~~status;
this.dragDisabled = ~~status;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this in this place is single grid object, but in my opinion, it's better to keep dragDisabled state inside the plugin instead of performing modification in main grid itself

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

Successfully merging this pull request may close these issues.

None yet

2 participants