|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/mguerinweb/Offline_Archive/TableEditor/ |
Upload File : |
<public:event name="onrowselect" ID=rowSelect />
<public:property name="hlColor" />
<public:property name="slColor" />
<PUBLIC:ATTACH EVENT="ondetach" ONEVENT="cleanup()" />
<script language=jscript>
var currRow = -1;
var selRow = -1;
if (element.tagName == 'TABLE')
{
element.attachEvent('onmouseover', onMouseOver);
element.attachEvent('onmouseout', onMouseOut);
element.attachEvent('onclick', onClick);
}
else
{
alert("Error: tablehl not attached to a table element");
}
function cleanup()
{
hilite(-1);
element.detachEvent('onmouseover', onMouseOver);
element.detachEvent('onmouseout', onMouseOut);
element.detachEvent('onclick', onClick);
}
function onClick()
{
srcElem = window.event.srcElement;
//crawl up the tree to find the table row
while (srcElem.tagName != "TR" && srcElem.tagName != "TABLE")
srcElem = srcElem.parentElement;
if(srcElem.tagName != "TR") return;
if(srcElem.rowIndex == 0 ) return;
if (selRow != -1) selRow.runtimeStyle.backgroundColor = '';
srcElem.runtimeStyle.backgroundColor = slColor;
selRow = srcElem;
var oEvent = createEventObject();
oEvent.selected = selRow;
rowSelect.fire(oEvent);
}
function onMouseOver()
{
srcElem = window.event.srcElement;
//crawl up to find the row
while (srcElem.tagName != "TR" && srcElem.tagName != "TABLE")
srcElem = srcElem.parentElement;
if(srcElem.tagName != "TR") return;
if (srcElem.rowIndex > 0)
hilite(srcElem);
else
hilite(-1);
}
function onMouseOut()
{
// Make sure we catch exit from the table
hilite(-1, -1);
}
function hilite(newRow)
{
if (hlColor != null )
{
if (currRow != -1 && currRow!=selRow)
{
currRow.runtimeStyle.backgroundColor = '';
}
if (newRow != -1 && newRow!=selRow)
{
newRow.runtimeStyle.backgroundColor = hlColor;
}
}
currRow = newRow;
}
</script>