jQuery - Make table rows selectable, draggable and droppable onto a box? (like SproutCore)
What I'm trying to do her开发者_开发技巧e is to mimic one part of the way SproutCore and Cappuccino work.
You know how Mail.app works? You click on a message, it gets selected? You Shift+Click, everything in between gets selected? You Command+Click, it gets added to that selection? You drag over many, they all get selected?
Then you can drag them all to another mailbox, a little red star with the number of rows selected shows up while dragging.
That is what I'm trying to do. There are lots of records that will need to be sorted out in that way in this project, the only problem is, I have no idea of how I can make table rows selectable and draggable? jQuery-UI doesn't work with tables.
Could you help?
Draggable With jQuery draggable plugin which is a part of the jQUery UI, you can set your selector yourself. For example a table row, that will work fine.
http://docs.jquery.com/UI/Draggable
There's also alot of options to make it behave the way you want, and you can also add callbacks with AJAX on what ever event you'd like.
Selectable
When it comes to selectable, I haven't tried it myself, but I read the Documentation, and it seems this is what you're looking for.
http://docs.jquery.com/UI/Selectable
Good luck!
精彩评论