Hello,
i tried the zii.widgets.jui.CJuiDraggable’ and Droppable Widget with Yii,
i’ve got two divs
<div id="dragable">
<img src="images/product0.png">
</div>
<div id="dropable">
<p style="background-color:#B3D4EF; height: 150px; width:150px; float:right; > </p>
</div>
first in the draggable the revert option doesnt work
in the droppable part i looking for something like a url option
i checked the option in jquery
http://jqueryui.com/demos/droppable/
some idea ?
how could i used something like url.
i like to do something when a draggable element is put in the droppable element.
<?php $this->beginwidget('zii.widgets.jui.CJuiDraggable', array(
'id' => 'dragable',
'options' => array(
'revert' => 'true')
)
);
$this->endwidget(); ?>
<?php $this->beginwidget('zii.widgets.jui.CJuiDroppable', array(
'id' => 'dropable',
'options' => array(
'accept' => 'dragable',
'url' => 'index.php?r=HelloWorld/drop',
)
)
);
$this->endwidget(); ?>
regards
anyone some idea ?
i tried with events drop but doesnt working
http://docs.jquery.com/UI/Droppable#options
<?php $this->beginwidget('zii.widgets.jui.CJuiDroppable', array(
'id' => 'dropable',
'drop' => 'index.php?r=HelloWorld/drop',
'options' => array(
'accept' => 'dragable',
)
)
);
$this->endwidget(); ?>
Yeti
(Chris)
3
Events go in the options array.
Make sure you have prefixed the event javascript with js:
$this->beginWidget('zii.widgets.jui.CJuiDroppable', array(
'options'=>array(
'scope'=>'myScope',
'drop'=>'js:function(event, ui){dropEventHandlerCode;}',
),
));
echo 'Your droppable content here';
$this->endWidget();
Hope this helps.
Took me a couple of days and raising a ticket to find this out. I have asked for a note go in the Zii JUI widgets documentation.
i tried this with droppable element but doesnt work
have you some example how can i call a other action when i put something
in droppable
<?php $this->beginwidget('zii.widgets.jui.CJuiDroppable', array(
'id' => 'dropable',
'options' => array(
'accept' => 'dragable',
'drop'=>'js:function(){alert();}'
)
)
);
$this->endwidget(); ?>
its doesnt work. have someone test
CJuiDraggable already ?
<?php $this->beginwidget('zii.widgets.jui.CJuiDraggable', array(
'id' => 'dragme',
'options' => array(
'scope' => 'myscope',
'revert' => true,
'opacity' => 0.35
)
));
$this->endwidget(); ?>
<?php
$this->beginWidget('zii.widgets.jui.CJuiDroppable', array(
'tagName' => 'dragme',
'options'=>array(
'scope' => 'myscope',
'accept' => 'dragme',
'hoverClass' => 'drophover',
'drop'=> "js:function(event, ui){alert('hello')}",
),
));