Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6815367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:47:55+00:00 2026-05-26T20:47:55+00:00

So on the left hand side of this page I will have an html

  • 0

So on the left hand side of this page I will have an html table which already has a function to add rows dynamically. On the right hand side I would like to have a bunch of pictures that can be dragged onto the html table and that will trigger the addRow() function adding a new row into the table containing the id from the picture. Can someone please tell me how to accomplish this?

EDIT: (answer to GrailsDev)

Well I haven’t tried it yet because my research wasn’t conclusive. I’m sure I want to do something like this:

$("#draggable").draggable(); $("#droppable").droppable({ drop: function() { alert('dropped'); } });

where the draggable would be the div encasing the images, however, I need to know how to get some information from the picture to put it into that drop function.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:47:55+00:00Added an answer on May 26, 2026 at 8:47 pm

    Okay, so the basic idea is that you’ll want a tbody and thead in your html, that way it’s possible to make tr tags in the tbody droppable slots while the header will not accept the images being dragged. Then you make the images draggable and the tr tags in the rows droppable elements that accept img.

    For this working example in fiddle, I put the ID in row 1, the title tag in as the name, and a copy of the image in as a thumbnail.

    Here is the jQuery code to get it running:

    jQuery(function($) {
        $('#rightcol img').draggable({
            helper: 'clone'
        });
    
        var dropProps = {
            accept: "img",
            activeClass: 'active',
            hoverClass: 'hover',
            drop: function(ev, ui) {
                console.log(ui);
                var $im = $(ui.draggable);
                var $row = $('<tr />').append(
                    $('<td />').html($im.attr('id'))
                ).append(
                    $('<td />').html($im.attr('title'))
                ).append(
                    $('<td />').append($im.clone().attr('id', null))
                ).droppable(dropProps);
                $(this).after($row);
            }
        };
    
        $('#leftcol table tbody tr').droppable(dropProps);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a single view which has a menu on the left hand side
I have a page like http://ratingscorner.com/mobiles if u see the left hand side there
I have a list of people on the left hand side of a page,
OK, this is my situation; I have a MasterPage. On the left hand side
I'm trying to place this menu on the left hand side of the page:
I want to duplicate the style of buttons on this page http://oakespavers.com/ (left-hand side)
If you visit this page: http://basecamphq.com/tour/ and click on the tour left hand side
A good example is the SO star on the left hand side of this
I have a div on the left hand side, and text on the right
I was looking to implement such menu as http://www.fogcreek.com/FogBugz/learnmore.html (Left hand side) Can anyone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.