Yii Framework Forum: draggable droppable - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

draggable droppable Rate Topic: -----

#1 User is offline   james2010 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 19-February 10

Posted 01 March 2010 - 01:40 PM

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
0

#2 User is offline   james2010 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 19-February 10

Posted 02 March 2010 - 03:21 PM

anyone some idea ?

i tried with events drop but doesnt working

http://docs.jquery.c...oppable#options




<?php $this->beginwidget('zii.widgets.jui.CJuiDroppable', array(
                'id' => 'dropable',
                'drop'    => 'index.php?r=HelloWorld/drop', 
                'options' => array(
                'accept' => 'dragable',
                )
                )
                );
                $this->endwidget(); ?>

0

#3 User is offline   Yeti 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 95
  • Joined: 30-May 09

Posted 10 March 2010 - 07:05 AM

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.
0

#4 User is offline   james2010 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 19-February 10

Posted 12 March 2010 - 04:54 AM

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(); ?>


0

#5 User is offline   james2010 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 19-February 10

Posted 16 April 2010 - 01:30 PM

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')}",

	),
));


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users