Custom active controls in Prado Part II

We’ve been working on getting drag-drop features to work in Prado for a while now, and we got it on a level which fills our needs.

The current state lets you register drags, drops and drag-drop. The most annoying limitation we have at the moment is that you only get the drop container on callback. We currently slip around that by sending our data with the callback parameters.

The demo attached here shows dragsdrops (green), drags (yellow) and drops (blue). When an element is dropped the label is updated with the name of the drop element and the callback parameter data. The callback data is currently set up in the js file and it’s only set for the dragdrop elements, but there should be nicer ways to do this.

The component only uses javascript that ships with Prado, so no external libs are required. The actual MyDraggable php class is based on another Prado component, and it probably needs some cleanup as well. The demo ships with Prado 3.1, so just unzip and set correct permissions.

Kudos goes to my co-worker Lars-Olav for getting the client side stuff to work. Javascript is not my strong side 😉

Online demo – http://prado.eirikhoem.net/dragdropdemo/www/
Download source – http://www.eirikhoem.net/dragdropdemo.tar.gz

Update: Source file is not up to date. Will fix asap.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: