Contact Us

If you are interested in our services leave your contact details below and our sales representatives will contact you.

The organization which you represent
Email address we will use to contact you
Longer contact form…
 
  • About

    mFabrik Blog is about mobile and web software development, open source and Linux. We tell exciting tales where business, technology, web and mobile convergence.

    Creative Commons License
    This work is licensed under a Creative Commons Attribution 3.0 Unported License.

Creating a drag’n'drop basket with jQueryUI

Posted on January 5, 2010  by Mikko Ohtamaa
Filed Under jquery, jqueryui, technology

I have created an example how to create a “basked” with jQuery and jQueryUI with the following features

  • The user can be pick items from the predefined set
  • Items are dragged and dropped to the basket
  • The basket value reflects a hidden input

This kind of user interface pattern is suitable for

  • Shopping carts
  • Travel planners

The example in fact bears the name “travel planner” but it is not tied to travel anyhow.

Note: this is just a screenshot - please see live example

basket

The example code uses

  • google.code() content delivery network to load jQuery and jQueryUI
  • jQueryUI draggable and droppable features
  • Well planned visual cues for the drag and drop operations: cursor changes, CSS hover classes
  • <form> which <input> value is updated according to the basket content – all selected item ids form a comma separated list

The example code is well-documented with links to the further documentation.

 

Other posts by Mikko Ohtamaa

 

Comments

2 Responses to “Creating a drag’n'drop basket with jQueryUI”

  1. tony on January 18th, 2010 7:27 pm
    Gravatar

    can you make a basic shopping site and cart with this code ? i saw a web page like this http://www.panic.com and another one http://www.dragdropcart.com

     
  2. Mikko Ohtamaa on January 18th, 2010 8:06 pm
    Gravatar

    The code is only for the cart. The shopping site needs lots of more: order registry, product registry and so on.

    There are lots of basic shopping sites ready:

    http://www.plonegetpaid.com/

    http://www.satchmoproject.com/

     

Leave a Reply