webgui/www/extras/yui-ext/docs/overview-summary-GridDD.js.html
JT Smith 4f68a0933c added YUI and YUI-ext
fixed the resizable text area with IE problem
fixed the ad space with IE problem
merged the 7.2.0 and 7.1.4 change logs
2006-11-07 23:15:57 +00:00

168 lines
7.9 KiB
HTML

<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
parent.document.title="GridDD.js Overview";
}
</script>
</head>
<body bgcolor="white" onload="asd();" style="margin:15px;">
<center>
<h2>GridDD.js</h2>
</center>
<h4>Summary</h4>
<p>
</p>
<table border="1" cellpadding="3" cellspacing="0" width="100%">
<tr bgcolor="#CCCCFF" class="TableHeadingColor">
<td colspan="2" class="title-cell">
<b>Class Summary</b>
</td>
</tr>
<tr bgcolor="white" class="TableRowColor">
<td width="15%"><b><a href="YAHOO.ext.grid.GridDD.html">YAHOO.ext.grid.GridDD</a></b></td>
<td>Custom implementation of YAHOO.util.DDProxy used internally by the grid
</td>
</tr>
</table>
<hr/>
<!-- ========== METHOD SUMMARY =========== -->
<!-- ========== END METHOD SUMMARY =========== -->
<pre class="sourceview">
<span class="comment">// kill dependency issue</span>
<span class="reserved">if</span>(YAHOO.util.DDProxy){
<span class="comment">/**
* <span class="attrib">@class</span>
* Custom implementation of YAHOO.util.DDProxy used internally by the grid
* <span class="attrib">@extends</span> YAHOO.util.DDProxy
*/</span>
YAHOO.ext.grid.GridDD = <span class="reserved">function</span>(grid, bwrap){
<span class="reserved">this</span>.grid = grid;
var ddproxy = document.createElement(<span class="literal">'div'</span>);
ddproxy.id = grid.container.id + <span class="literal">'-ddproxy'</span>;
ddproxy.className = <span class="literal">'ygrid-drag-proxy'</span>;
document.body.insertBefore(ddproxy, document.body.firstChild);
YAHOO.util.Dom.setStyle(ddproxy, <span class="literal">'opacity'</span>, .80);
var ddicon = document.createElement(<span class="literal">'span'</span>);
ddicon.className = <span class="literal">'ygrid-drop-icon ygrid-drop-nodrop'</span>;
ddproxy.appendChild(ddicon);
var ddtext = document.createElement(<span class="literal">'span'</span>);
ddtext.className = <span class="literal">'ygrid-drag-text'</span>;
ddtext.innerHTML = <span class="literal">"&amp;nbsp;"</span>;
ddproxy.appendChild(ddtext);
<span class="reserved">this</span>.ddproxy = ddproxy;
<span class="reserved">this</span>.ddtext = ddtext;
<span class="reserved">this</span>.ddicon = ddicon;
YAHOO.util.Event.on(bwrap, <span class="literal">'click'</span>, <span class="reserved">this</span>.handleClick, <span class="reserved">this</span>, true);
YAHOO.ext.grid.GridDD.superclass.constructor.call(<span class="reserved">this</span>, bwrap.id, <span class="literal">'GridDD'</span>,
{dragElId : ddproxy.id, resizeFrame: false});
<span class="reserved">this</span>.unlockDelegate = grid.selModel.unlock.createDelegate(grid.selModel);
};
YAHOO.extendX(YAHOO.ext.grid.GridDD, YAHOO.util.DDProxy);
YAHOO.ext.grid.GridDD.<span class="reserved">prototype</span>.handleMouseDown = <span class="reserved">function</span>(e){
var row = <span class="reserved">this</span>.grid.getRowFromChild(YAHOO.util.Event.getTarget(e));
<span class="reserved">if</span>(!row) <span class="reserved">return</span>;
<span class="reserved">if</span>(<span class="reserved">this</span>.grid.selModel.isSelected(row)){
YAHOO.ext.grid.GridDD.superclass.handleMouseDown.call(<span class="reserved">this</span>, e);
}<span class="reserved">else</span> {
<span class="reserved">this</span>.grid.selModel.unlock();
YAHOO.ext.EventObject.setEvent(e);
<span class="reserved">this</span>.grid.selModel.rowClick(<span class="reserved">this</span>.grid, row.rowIndex, YAHOO.ext.EventObject);
YAHOO.ext.grid.GridDD.superclass.handleMouseDown.call(<span class="reserved">this</span>, e);
<span class="reserved">this</span>.grid.selModel.lock();
}
};
YAHOO.ext.grid.GridDD.<span class="reserved">prototype</span>.handleClick = <span class="reserved">function</span>(e){
<span class="reserved">if</span>(<span class="reserved">this</span>.grid.selModel.isLocked()){
setTimeout(<span class="reserved">this</span>.unlockDelegate, 1);
YAHOO.util.Event.stopEvent(e);
}
};
<span class="comment">/**
* Updates the DD visual element to allow/not allow a drop
* <span class="attrib">@param</span> {Boolean} dropStatus True if drop is allowed on the target
*/</span>
YAHOO.ext.grid.GridDD.<span class="reserved">prototype</span>.setDropStatus = <span class="reserved">function</span>(dropStatus){
<span class="reserved">if</span>(dropStatus === true){
YAHOO.util.Dom.replaceClass(<span class="reserved">this</span>.ddicon, <span class="literal">'ygrid-drop-nodrop'</span>, <span class="literal">'ygrid-drop-ok'</span>);
}<span class="reserved">else</span>{
YAHOO.util.Dom.replaceClass(<span class="reserved">this</span>.ddicon, <span class="literal">'ygrid-drop-ok'</span>, <span class="literal">'ygrid-drop-nodrop'</span>);
}
};
YAHOO.ext.grid.GridDD.<span class="reserved">prototype</span>.startDrag = <span class="reserved">function</span>(e){
<span class="reserved">this</span>.ddtext.innerHTML = <span class="reserved">this</span>.grid.getDragDropText();
<span class="reserved">this</span>.setDropStatus(false);
<span class="reserved">this</span>.grid.selModel.lock();
<span class="reserved">this</span>.grid.fireEvent(<span class="literal">'startdrag'</span>, <span class="reserved">this</span>.grid, <span class="reserved">this</span>, e);
};
YAHOO.ext.grid.GridDD.<span class="reserved">prototype</span>.endDrag = <span class="reserved">function</span>(e){
YAHOO.util.Dom.setStyle(<span class="reserved">this</span>.ddproxy, <span class="literal">'visibility'</span>, <span class="literal">'hidden'</span>);
<span class="reserved">this</span>.grid.fireEvent(<span class="literal">'enddrag'</span>, <span class="reserved">this</span>.grid, <span class="reserved">this</span>, e);
};
YAHOO.ext.grid.GridDD.<span class="reserved">prototype</span>.autoOffset = <span class="reserved">function</span>(iPageX, iPageY) {
<span class="reserved">this</span>.setDelta(-12, -20);
};
YAHOO.ext.grid.GridDD.<span class="reserved">prototype</span>.onDragEnter = <span class="reserved">function</span>(e, id) {
<span class="reserved">this</span>.setDropStatus(true);
<span class="reserved">this</span>.grid.fireEvent(<span class="literal">'dragenter'</span>, <span class="reserved">this</span>.grid, <span class="reserved">this</span>, id, e);
};
YAHOO.ext.grid.GridDD.<span class="reserved">prototype</span>.onDragDrop = <span class="reserved">function</span>(e, id) {
<span class="reserved">this</span>.grid.fireEvent(<span class="literal">'dragdrop'</span>, <span class="reserved">this</span>.grid, <span class="reserved">this</span>, id, e);
};
YAHOO.ext.grid.GridDD.<span class="reserved">prototype</span>.onDragOver = <span class="reserved">function</span>(e, id) {
<span class="reserved">this</span>.grid.fireEvent(<span class="literal">'dragover'</span>, <span class="reserved">this</span>.grid, <span class="reserved">this</span>, id, e);
};
YAHOO.ext.grid.GridDD.<span class="reserved">prototype</span>.onDragOut = <span class="reserved">function</span>(e, id) {
<span class="reserved">this</span>.setDropStatus(false);
<span class="reserved">this</span>.grid.fireEvent(<span class="literal">'dragout'</span>, <span class="reserved">this</span>.grid, <span class="reserved">this</span>, id, e);
};
};</pre>
<hr>
<hr>
<font size="-1">
</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Sat Oct 14 06:07:10 2006</div>
</body>
</html>