Class \Prado\Web\UI\JuiControls\TJuiDroppable
TJuiDroppable class.
TJuiDroppable is an extension to TActivePanel based on jQuery-UI's Droppable interaction. When a TJuiDraggable is dropped over a TJuiDroppable panel, the \Prado\Web\UI\JuiControls\onDrop event will be triggered. The event hanler will receive a TJuiEventParameter object containing a reference to the dropped control in the DraggableControl property.
<com:TJuiDraggable
ID="drag1"
Style="border: 1px solid red; width:100px;height:100px;background-color: #fff"
>
drag me
</com:TJuiDraggable>
<com:TJuiDroppable
ID="drop1"
Style="border: 1px solid blue; width:600px;height:600px; background-color: lime"
OnDrop="drop1_ondrop"
>
drop it over me
</com:TJuiDroppable>
public function drop1_ondrop($sender, $param)
{
$draggable=$param->DraggableControl;
$offset=$param->getCallbackParameter()->offset;
$target=$param->getCallbackParameter()->target->offset;
$top=$offset->top - $target->top;
$left=$offset->left - $target->left;
$this->label1->Text="Dropped ".$draggable->getID()." at: <br/>Top=".$top." Left=".$left;
}
Class hierarchy
- \Prado\Web\UI\JuiControls\TJuiDroppable implements IJuiOptions, ICallbackEventHandler
- \Prado\Web\UI\ActiveControls\TActivePanel implements IActiveControl
- \Prado\Web\UI\WebControls\TPanel
- \Prado\Web\UI\WebControls\TWebControl implements IStyleable
- \Prado\Web\UI\TControl implements IRenderable, IBindable
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.3
public
|
__construct() : mixed
Creates a new callback control, sets the adapter to
TActiveControlAdapter. If you override this class, be sure to set the
adapter appropriately by, for example, by calling this constructor.
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
onCallback(TCallbackEventParameter $param) : mixed
This method is invoked when a callback is requested. The method raises
'OnCallback' event to fire up the event handlers. If you override this
method, be sure to call the parent implementation so that the event
handler can be invoked.
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
raiseCallbackEvent(TCallbackEventParameter $param) : mixed
Raises callback event. This method is required by the {@see \Prado\Web\UI\ActiveControls\ICallbackEventHandler}
interface.
|
protected
|
addAttributesToRender(mixed $writer) : mixed
Ensure that the ID attribute is rendered and registers the javascript code
for initializing the active control.
|
protected
|