PDA

View Full Version : Basic single selection grid (Drag/Drop)



PCSpectra
18 Jan 2010, 12:42 PM
I have finally managed to get some DD funcitonality goijng thanks to this article:

http://hamisageek.blogspot.com/2009/02/extjs-tip-sortable-grid-rows-via-drag.html

I read the articles on here, looked at every example and Googled for hours using a few 'extensions' which seemed buggy.

This code above is perfect, except that I would really like to give the user a clearer idea as to where the drop target exists. I assume I could set the style of the ohvered over item and somehow draw a bottom border to indicate this is where the drop will ocurr???

How could I do this easily? Can someone show me the code required for such a task...

EDIT | Found a very similar article but better written and probably the original author:

http://www.vinylfox.com/getting-started-with-grid-drag-drop/

Cheers,
Alex

VinylFox
18 Jan 2010, 3:32 PM
Take a look at this - sounds like what you want.

http://tdg-i.com/149/a-quick-demo-of-ext-js-in-actions-chapter-11-drag-and-drop-with-grids

PCSpectra
18 Jan 2010, 4:09 PM
I have watched that video once already but it doesnt answer any questions I have, it's more promotion for a book??? I watched it without audio though so I may have missed some critical content.

I have also read his article(s) on drag and drop...I guess I was under the impression grid implemented drag and drop like a tree control:

http://www.extjs.com/deploy/dev/examples/tree/reorder.html

This appears to not be the case, and so a more manual implementation on my end is going to be required.

Cheers,
Alex

VinylFox
18 Jan 2010, 6:47 PM
Well maybe the code for that example will help you out more...

http://extjsinaction.com/examples/chapter14/dnd_grid_to_grid.html

Im more of an example code learner myself, so much like you, the videos are not as helpful. Though they are quite inspiring.

PCSpectra
18 Jan 2010, 7:28 PM
I watched the video with audio, it would be nice to watch that before I got as involved as I already have. :P

Looking at the source leaves me in awe of what is being done with JS. I remember thinking WYSIWYG editors were cool but extJS is unbelievable.

p.s-Thanks for the link that will certainly help me much more, thanks again :)

Cheers,
Alex

PCSpectra
19 Jan 2010, 4:20 PM
Just an update, but that demo really helped and I finally got the code working. Awesome :)