[Catalyst] Catalyst + Ajax
Andreas Marienborg
omega at palle.net
Fri Dec 2 07:46:59 CET 2005
On 1. des. 2005, at 15.31, Chisel Wright wrote:
>
> The other one that's got me stumped at the moment is doing something
> useful when a dragged element is dropped somewhere.
>
> I've got the draggable portion working, and I'm seeing a Catalyst
> called
> when the element is released in my dropzone. I just have no idea
> how to
> return anything from the action that has an effect. I've tried
> $c->res->output($prototype->update_element_function(..)) without any
> luck,
>
> ---- cut here ----
> <img src="static/images/btn_120x50_powered.png" width="120"
> height="50"
> id="product_1" class="product" />
> [% c.prototype.draggable_element('product_1', {revert => 'true'}) %]
>
> <img src="static/images/btn_120x50_powered.png" width="120"
> height="50"
> id="product_2" class="product" />
> [% c.prototype.draggable_element('product_2', {revert => 'true'}) %]
>
> <div class="dropbox" id="cart">
> <span style="vertical-align: bottom;">Drop an image here</style>
> </div>
> [% drop_url = base _ 'dragdrop/dropped' %]
> [% c.prototype.drop_receiving_element (
> 'cart',
> {
> accept => 'product',
> url => drop_url,
> hoverclass => 'dropbox_active',
> }
> )
> %]
> <p> </p>
> <div id="status"></div>
Droppables dont do no nothing on a drop except send of the request to
the URL specified, unless you create some handler-functions for it to
do when the item is dropped (called onDrop cleverly enough).
The other handler you can attach to a droppable is onHover, which
will trigger when an _accepted_ item is hovered over the droppable
did that make it any clearer? afaik, there is no way to have a
Droppable do anything "at the end of teh request", effectivly
removing any error-checking possibilites etc.
andreas
More information about the Catalyst
mailing list