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

  • SEARCH
  • Home
  • 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 859949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:44:47+00:00 2026-05-15T08:44:47+00:00

Basically there are two tables: Companies and visitors. Currently it’s possible to drag visitors

  • 0

Basically there are two tables: Companies and visitors. Currently it’s possible to drag visitors to companies. Works great. As soon as the drop function occurs, there are two $.post’s. The first one saves the drag to the database. The second one updates the visitors, because the information constantly changes. The problem, however is that as soon as the second $.post finishes, Firebug keeps popping the following error:

d(this).data("draggable") is null

Which occurs in the jQuery UI file. On line 56.

about 400 times or so. So basically I’m looking for a way to do live() with draggable and droppable.

The .draggables are in #visitors (an ul). The droppables are in #companies (a table).

Thanks!

$(".draggable").draggable({
    revert:true
});
$(".droppable").droppable({
    drop: function(ev, ui) {
        $(this).text($(ui.draggable).text());

        $.post('planning/save_visit', {user_id: $(ui.draggable).attr('id'), company_id: $(this).attr('id'), period: $('ul.periods li.active').attr('id')});

        $.post('planning/' + $('ul.periods li.active').attr('id'), {visitors:true}, function(data){
            $('#visitors').html(data);
        });
    },
    hoverClass: 'drophover'
});
  • 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-15T08:44:48+00:00Added an answer on May 15, 2026 at 8:44 am

    When reloading the visitors you are replacing all the draggable elements when you do $('#visitors').html(data); – so those there were draggable before are deleted and replaced with new elements that are not draggable. (I’m pretty sure you realise this, because of mentioning .live(), so this is really just here for completeness)

    However, you know exactly when the visitor elements are changed, so instead of an alternative to .live() why not just make another request for the draggable effect immediately after the change. Might be safer to “destroy” the old draggables before you replace them, but I’m not sure if that’s strictly necessary.

    $.post('planning/' + $('ul.periods li.active').attr('id'), {visitors:true}, function(data){      
        $(".draggable").draggable("destroy");
        $('#visitors').html(data); 
        $(".draggable").draggable({ revert:true }); 
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We've run across a slightly odd situation. Basically there are two tables in one
Basically there are two Kinect devices. One for the Xbox and one for the
I have some localization problems in my webpage. There are basically two problems (that
Basically I have two 2D points and there is a line between them. A
Is this even possible? Basically, I want to turn these two calls to sub
I have two tables. Table A contains a list of departments, there are 20
So I have these two tables in my database: Companies -------------------- CompanyID (PK) Name
Basically, I have two tables that have a 1 to 1 relation. When I
Brief: I'm fairly new to databases and currently have one with two tables for
Basically, I have two tables, admin_privilege and admin_roll_privilege. I'm trying to write a query

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.