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 4059392
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:12:11+00:00 2026-05-20T15:12:11+00:00

I have a requirement that very closely matches this Jquery demo , which is

  • 0

I have a requirement that very closely matches this Jquery demo, which is a simple shopping cart demo. Basically I need to make two enhancements into this demo.

  1. I need a text input alongwith with the available “products”. So when I drag-drop one of the products, the text fields should be dragged along with that, which will be filled by user in the “cart” field.

  2. I need a “cross” in front of each item in cart, which can be used to delete a certain item. Jquery’s “destroy” function doesn’t seem to do that. So how can I accomplish deletion of items from shopping cart?

Thanks for all the help.

  • 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-20T15:12:12+00:00Added an answer on May 20, 2026 at 3:12 pm

    You can specify your own “helper” on the draggable definition. Whatever html you specify as your helper is what will be shown during the drag animation. In your sortable (the drop area in the demo) you can override the beforeStop function. In there you can replace the item with whatever you want to be actually dropped into your shopping cart. In that, you could add the X button with javascript or something to remove the item

    I recently implemented this to drag from a datatable into a list, so had to convert the tr into an li. It works in jQuery 1.4 but I get strange results on the drop when I drag out of the top in 1.5, and I haven’t resolved that yet. Here’s my helper defintion

    helper: function() {
            var text = this.children[0].innerText;
            var result = "<li id='"+this.id+"'>"+text+"</li>";
            return result;
        },
    

    and here’s my beforeStop function

    beforeStop: function( event, ui ) {
            var id = ui.helper.attr( "id" );
            var text = ui.helper.text();
            var li = "<li id='"+id+"'>"+text+"</li>";
            $(ui.item).replaceWith( li );
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the requirement that I need to open a document in Microsoft word
I have a requirement that I need to show my records in a gridview
I have a text file that contains very long lines. I need one piece
I have created a very simple WCF service, hosted on windows service, closely following
I have a requirement that states to use only plain JavaScript and not jQuery.
In our project we have requirement that, after receiving sms message from third party
I have a requirement that when the user clicks on [X] button of the
I have a requirement that I want to check the request headers and according
I have a requirement that a user is allowed only to enter string value
I have one requirement that i have to place the log file in the

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.