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 jquery+ui and removal of old (unstable) libraries #14

Closed
blackshadev opened this issue Aug 11, 2015 · 12 comments
Closed

Update jquery+ui and removal of old (unstable) libraries #14

blackshadev opened this issue Aug 11, 2015 · 12 comments

Comments

@blackshadev
Copy link

Since the original project isn't maintained anymore and the necessary libraries are highly outdated. Wouldn't it be nice if this version would have support for the latest jquery+ui and removed the outdated jquery.event.drag.js ?

I have run in allot of trouble with slickgrid due to the lack of support for the newer versions of said libraries. Are you planning on supporting these?

@6pac
Copy link
Owner

6pac commented Aug 12, 2015

The libraries in this fork are at 1.11.2. Is that new enough ?

When I updated the libraries I checked out jquery.event.drag.js and couldn't see a problem. Are you saying jQueryUI has a drag event now that supersedes it ? I haven't looked into it.

This fork has quite a few patches that fix issues with jQuery 1.8+. Check out the commit list to see what has been fixed.

As I say in the wiki, this is a non customised fork that has only updates, bug fixes and minor enhancements posted to it. Everything should be squeaky clean and up to date.

@blackshadev
Copy link
Author

I just read the wiki page you were referring to. In case of jQuery, I meant the 2.1.4 version instead of the 1.11.2. I get that most people want the support for older browsers, but would it be possible to run under 2.1.4, since I don't need that?

And as far as I know jQueryUI draggable have implemented all handles necessary which where present in jquery.event.drag.js. I even ran into some issues with jqueryUI draggable because jquery.event.drag.js stole some of the events from jqueryUI.

Anyway, this is a great thing you are doing, even tough it is a shame that the original maker of SlickGrid doesn't maintain it anymore. His work is amazing, I have used SlickGrid allot over the past few years.

@6pac
Copy link
Owner

6pac commented Aug 12, 2015

I have also been assuming, though I admit I've never actually tried it, that dropping 2.1.4 in will be equivalent in API to 1.11.2 but just support less browsers. Is this not true ?

I will look into retiring the custom draggable library, it may take me a week or so to get around to it.

Thanks, it's a grid I use a lot too, so it's good to give back a bit.

@blackshadev
Copy link
Author

jQuery 2.1.4 seems to work fine on your grid, so great work on that one.

And jQueryUI draggable seems to work as well with minor changes needed. See my pull request, it isn't much, but it seems to work for me.

@mgpGit-zz
Copy link

+1

I see you've done a release not too far back and this is a very fresh change. Any idea when you hope to release another version with these changes?

Tks!

@6pac
Copy link
Owner

6pac commented Aug 14, 2015

Actually, blackshadev looked into it a bit more and found that the external and jQueryUI drag libraries have quite different functionality when it comes to attaching to DOM objects.
See: #15

I reverted the changes. We'll look into it, but since the current setup works I think the best solution is probably to re-namespace the external libraries to avoid mixing of objects as seems to have triggered the original actions.

@blackshadev
Copy link
Author

I did a little more investigating and this is what I found.
Firstly drag and drop support is build into HTML now a days (source: http://www.w3schools.com/html/html5_draganddrop.asp). But SlickGrid depends on some things that jquery.drag.event.js does. For instance the creation of a extra event argument (referred to as dd) which add jQuery handles to the drag handle and other visual injected things like a dropping guide. The question is, how to work around this.

@blackshadev
Copy link
Author

Ok this is how far I got, native browser dragging seems to work pretty well. I am not confident enough to make a pull request because it has some quirks. If anyone knows anythong about drag/drop with the normal HTML events, be so kind to take a look at example9. The first row can't be dragged for some reason. The drag events which Slick.Grid binds can be found at slick.grid.js:2354-2391. Example9 used the rowmovemanager plugin which subscribes to the events which SlickGrid emits, these can be found at plugins/slick.rowmovemanager.js:39-134.

I solved the event arguments problem by binding a data element to the cell when dragging, with the jquery.data function. If anybody knows a cleaner solution to have a data object persistent over a dragging session, feel free to suggest it or put it in, when this works I will do a pull request to 6pac.

https://github.com/blackshadev/SlickGrid

@6pac
Copy link
Owner

6pac commented Aug 15, 2015

Thanks for all the investigations.
I'm not really confident to depend on native browser dragging. I know from your earlier comments that you only need to support the latest, but SlickGrid in general needs to support back to IE7 etc. Add to that quirks in individual browsers, and things get even more sketchy.
Using jQueryUI drag is probably a partial tonic for this, since it will support earlier browser versions and, if possible, will work around browser-specific inconsistencies.

I don't really have time to go down that rabbit hole, given that the current configuration is actually working.
But I'm happy to bundle up your pull request as an optional patch once it's tested.

@blackshadev
Copy link
Author

Ok, I have used the jQuery event binder to bind the drag,dragstart and dragend event. I don't know if they do some tricks to fix them in IE9-. Could someone check this?

@6pac
Copy link
Owner

6pac commented Aug 17, 2015

I downloaded your repo and checked Example-9.
In Chrome:

  • row reordering works, but not for the first row
  • the drag of the row body to the recycle bin doesn't work

Nothing is working for me in IE8.

Again, apologies I can't assist, but I am just too busy at the moment. I'm happy to put things like this on the backburner, which usually means they get solved in a month or so as I get an hour here and there. A high level of testing is required before letting it loose.

@6pac
Copy link
Owner

6pac commented Aug 17, 2015

I think you should read this: http://www.quirksmode.org/blog/archives/2009/09/the_html5_drag.html
It does appear that jQueryUI supports IE8+, so in theory draggable and droppable should work, but they do seem to work in quite a different way to the HTML5 standard.
After the quirksmode article, I'm wondering if the best bet is just to leave it as it is and count our blessings.

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