JQuery - Make table rows selectable, draggable and drop onto a box? (e.g. SproutCore)

What I'm trying to do here is to imitate one part of SproutCore and Cappuccino.

Do you know how Mail.app works? You click on the message, is it selected? Are you Shift + Click, all that is selected? You are Command + Click, is it added to this selection? You drag a lot, are they all selected?

Then you can drag them all to another mailbox, a small red star appears with the number of rows selected when you drag it.

Here is what I am trying to do. There are many records that will need to be sorted this way in this project, the only problem is I don’t know how I can make row tables selectable and draggable? jQuery-UI does not work with tables.

Could you help me?

+3
source share
1 answer

Draggable With the jQuery draggable plugin, which is part of the jQuery user interface, you can customize your selector yourself. For example, a row in a table that will work fine.

http://docs.jquery.com/UI/Draggable

There are also many options to make it behave the way you want, and you can also add AJAX callbacks at any time that you would like.

The choice

When it comes to choices, I have not tried it myself, but I have read the documentation and it seems like this is what you are looking for.

http://docs.jquery.com/UI/Selectable

Good luck

+2
source

Source: https://habr.com/ru/post/1760345/


All Articles