Drag-and-Drop Effects"

From Documentation
m (Created page with '{{ZKClient-sideReferencePageHeader}} =Version History= {{LastUpdated}} {| border='1px' | width="100%" ! Version !! Date !! Content |- |   |   |   |} {{ZKClient-s…')
 
m
Line 1: Line 1:
 
{{ZKClient-sideReferencePageHeader}}
 
{{ZKClient-sideReferencePageHeader}}
 +
 +
There are two levels to customize the drag-and-drop effects: per-widget and browser-level.
 +
 +
= Per-Widget Customization =
 +
 +
= Browser-level Customization =
 +
 +
<javadoc directory="jsdoc">zk.DnD</javadoc> provides a collection of drag-and-drop utilities. By customizing it, all widgets in the same browser will be affected.
 +
 +
For example, if you would like customize ''ghosting" of the DOM element being dragged, you could override <javadoc method="ghost(zk.Draggable, _global_.Offset, _global_.String)" directory="jsdoc">zk.DnD</javadoc> as follows.
 +
 +
<source lang="javascript">
 +
var superghost = zk.DnD.ghost;
 +
zk.DnD.ghost = function (drag, ofs, msg) {
 +
    if (msg != null)
 +
        return superghost(drag, ofs, msg);
 +
  //do whatever you want
 +
}
 +
</source>
  
 
=Version History=
 
=Version History=

Revision as of 01:56, 22 December 2010


Drag-and-Drop Effects



There are two levels to customize the drag-and-drop effects: per-widget and browser-level.

Per-Widget Customization

Browser-level Customization

DnD provides a collection of drag-and-drop utilities. By customizing it, all widgets in the same browser will be affected.

For example, if you would like customize ghosting" of the DOM element being dragged, you could override DnD.ghost(Draggable, Offset, String) as follows.

var superghost = zk.DnD.ghost;
zk.DnD.ghost = function (drag, ofs, msg) {
    if (msg != null)
        return superghost(drag, ofs, msg);
   //do whatever you want
}

Version History

Last Update : 2010/12/22


Version Date Content
     



Last Update : 2010/12/22

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.