Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-05-27 14:23:50

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

OT (sorta): DHTML drag-drop sorting interface

This isn't immediatly related to Xinha (but might be in V2 for sorting toolbar groups), I'm looking for an example of a DHTML (Javascript) interface for sorting a list of items by dragging an item and dropping it into another position in the list.

Has anybody seen anything like that?  The only dragging stuff I can seem to find is for dragging layers around to arbitrary positions, rather than dragging static page elements into alternate locations.


James Sleeman

Offline

#2 2005-05-27 16:08:16

Yermo
Xinha Authority
From: College Park, Md, USA
Registered: 2005-02-13
Posts: 143
Website

Re: OT (sorta): DHTML drag-drop sorting interface

gogo wrote:

This isn't immediatly related to Xinha (but might be in V2 for sorting toolbar groups), I'm looking for an example of a DHTML (Javascript) interface for sorting a list of items by dragging an item and dropping it into another position in the list.

Has anybody seen anything like that?  The only dragging stuff I can seem to find is for dragging layers around to arbitrary positions, rather than dragging static page elements into alternate locations.

I have a complete implementation that I put together a while ago that I can give you. I just need to package it up for you. I call it draglist.


-----------------------------------------------------------------------------------------
Content Management with Business Intelligence      [url]http://www.formvista.com[/url]

Offline

#3 2005-05-27 16:11:56

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: OT (sorta): DHTML drag-drop sorting interface

you da man yermo smile


James Sleeman

Offline

#4 2005-05-27 16:17:51

Yermo
Xinha Authority
From: College Park, Md, USA
Registered: 2005-02-13
Posts: 143
Website

Re: OT (sorta): DHTML drag-drop sorting interface

gogo wrote:

you da man yermo smile

I'm going to put up a sample of what it does so you can look at it. Am packaging it up right now.


-----------------------------------------------------------------------------------------
Content Management with Business Intelligence      [url]http://www.formvista.com[/url]

Offline

#5 2005-05-27 17:14:18

Yermo
Xinha Authority
From: College Park, Md, USA
Registered: 2005-02-13
Posts: 143
Website

Re: OT (sorta): DHTML drag-drop sorting interface

gogo wrote:

you da man yermo smile

smile

Ok, I've ripped the code out of formVista and packaged it up well enough that it runs outside of the framework.

Let me know if this is what you were looking for:

http://www.formvista.com/uploaded_html/demos/draglist

Each item in the list is a <div> that is given a unique id which was to be an integer. The values are the order. On submit the new order of the items in the list is queried and the value fields are updated before submission.

If this is what you're looking for I'll package up a download for you. It's been quite a while since I've looked at this code.


-----------------------------------------------------------------------------------------
Content Management with Business Intelligence      [url]http://www.formvista.com[/url]

Offline

#6 2005-05-28 01:18:52

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: OT (sorta): DHTML drag-drop sorting interface

wow, nice script!
what licence is it?


Niko

Offline

#7 2005-05-28 02:17:06

Yermo
Xinha Authority
From: College Park, Md, USA
Registered: 2005-02-13
Posts: 143
Website

Re: OT (sorta): DHTML drag-drop sorting interface

niko wrote:

wow, nice script!
what licence is it?

Something essentially free. Creative Commons Attribution sound good? The underlying dom-drag library uses that license which I think states that you just have to give me/my company some credit in the headers and you cant' claim you wrote it but otherwise are free to do with it what you want.

I'll package it up as a download once I get a chance. Maybe tomorrow.


-----------------------------------------------------------------------------------------
Content Management with Business Intelligence      [url]http://www.formvista.com[/url]

Offline

#8 2005-05-28 04:26:57

Foxx
Xinha Community Member
Registered: 2005-02-20
Posts: 41

Re: OT (sorta): DHTML drag-drop sorting interface

nice script, maybe you could add some lines somewhere stating that as soon as you click on an item, it is put on top, now if you select the first item, you drag it behind the other items. besides that, very nice! smile

Offline

#9 2005-05-28 09:30:29

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: OT (sorta): DHTML drag-drop sorting interface

Looks nice, not quite what I was looking for but I might be able to do a bit of hacking to it smile.  For reording Xinha toolbars though it looks like just the thing (cept we will be using it horizontally smile)


James Sleeman

Offline

#10 2005-05-28 13:28:25

Yermo
Xinha Authority
From: College Park, Md, USA
Registered: 2005-02-13
Posts: 143
Website

Re: OT (sorta): DHTML drag-drop sorting interface

gogo wrote:

Looks nice, not quite what I was looking for but I might be able to do a bit of hacking to it smile.  For reording Xinha toolbars though it looks like just the thing (cept we will be using it horizontally smile)

The underlying dom-drag.js file:

http://youngpup.net/2001/domdrag

provides a nice interface to drag and drop. The draglist.js file itself is based on work from:

http://blog.simon-cozens.org/6785.html

I'm packaging up what I have and will make a post once it's avialable.


-----------------------------------------------------------------------------------------
Content Management with Business Intelligence      [url]http://www.formvista.com[/url]

Offline

#11 2005-05-28 14:56:08

Yermo
Xinha Authority
From: College Park, Md, USA
Registered: 2005-02-13
Posts: 143
Website

Re: OT (sorta): DHTML drag-drop sorting interface

gogo wrote:

Looks nice, not quite what I was looking for but I might be able to do a bit of hacking to it smile.  For reording Xinha toolbars though it looks like just the thing (cept we will be using it horizontally smile)

Ok. I've packaged what I have. It's now available for download at:

http://www.formvista.com/otherprojects/draglist.html

If you use it please let me know what you think and any suggestions on improvements. The code leaves a bit to be desired.


-----------------------------------------------------------------------------------------
Content Management with Business Intelligence      [url]http://www.formvista.com[/url]

Offline

#12 2005-05-29 20:14:10

mtmosier
New member
Registered: 2005-05-14
Posts: 3

Re: OT (sorta): DHTML drag-drop sorting interface

Very nice, thanks for this.

Modified draglist.js to work horizontally.
http://office.astrolabe.com/demo/dragli … raglist.js

Here's the diff.
http://office.astrolabe.com/demo/dragli … list.patch

Last edited by mtmosier (2005-05-29 20:14:41)

Offline

#13 2005-05-30 10:15:20

guillaumed
Xinha Administrator
From: Lyon, France
Registered: 2005-02-23
Posts: 85

Re: OT (sorta): DHTML drag-drop sorting interface

Great result.. big_smile
Good idea to raise this thread..

Offline

#14 2005-05-31 11:08:59

kimss
Xinha Pro
From: Sweden
Registered: 2005-04-05
Posts: 99
Website

Re: OT (sorta): DHTML drag-drop sorting interface

Hey Yermo, great work. Ive been looking for such an example myself several times and this hit the spot. Last time I saw a drag'n'drop which accually works was in the Statistics software Livestats, which has a similar feature.

Thumbs up for this one, big_smile

Offline

#15 2005-05-31 14:02:58

Yermo
Xinha Authority
From: College Park, Md, USA
Registered: 2005-02-13
Posts: 143
Website

Re: OT (sorta): DHTML drag-drop sorting interface

kimss wrote:

Hey Yermo, great work. Ive been looking for such an example myself several times and this hit the spot. Last time I saw a drag'n'drop which accually works was in the Statistics software Livestats, which has a similar feature.

Thumbs up for this one, big_smile

Cool. Thanks. I had been planning to release this for quite some time (over a year now). The request from Gogo just pushed me enough to get it done.

I want to find the time to do what I call "draggrid". Same idea, except along the lines of a grid or photogallery. It's a bit more tricky to do.

-- Yermoi


-----------------------------------------------------------------------------------------
Content Management with Business Intelligence      [url]http://www.formvista.com[/url]

Offline

#16 2005-05-31 14:04:47

Yermo
Xinha Authority
From: College Park, Md, USA
Registered: 2005-02-13
Posts: 143
Website

Re: OT (sorta): DHTML drag-drop sorting interface

If you have any questions, comments or patches about draglist please post them to the formvista forum at

http://www.formvista.com/forum.html

It'll make it alot easier on me to keep track of things.

Thanks!

-- Yermo


-----------------------------------------------------------------------------------------
Content Management with Business Intelligence      [url]http://www.formvista.com[/url]

Offline

#17 2005-05-31 18:56:03

kimss
Xinha Pro
From: Sweden
Registered: 2005-04-05
Posts: 99
Website

Re: OT (sorta): DHTML drag-drop sorting interface

draggrid sounds very usefull, ill check in by your forum. im testing the psp browserhack now, so typing is kinda timeconcuming, but cool, smile

Offline

Board footer

Powered by FluxBB