Copy Code code as follows:
<public:attach event= "Ondocumentready" onevent= "Doinit ()"/>
<public:attach event= "onmouseover" onevent= "Domouseover ()"/>
<public:attach event= "onclick" onevent= "DoClick ()"/>
<public:attach event= "onmouseout" onevent= "domouseout ()"/>
<public:property name= "Test"/>
<script language= "JavaScript" >
var lastobj = null;
var lastcolor = null;
function Doinit () {
if (element==null) {
Return
}
var objt = element.children[0];
try{
Objt.rows (0). Classname= "Grid_title";
Objt.rows (1). Classname= "Grid_title";
}
catch (Err) {
Objt.classname= "Grid_title";
}
OBJT = element.children[1];
if (objt.rows (0) ==null) {
Return
}
Objt.rows (0). Classname= "Gridding1";
for (i=1;i<objt.rows.length;i++) {
if (i%2==1) {
Objt.rows (i) classname= "gridding1";
}
else{
Objt.rows (i) classname= "gridding1";
}
}
}
function DoClick () {
if (event.srcelement.tagname== "TD") {
var curobj = event.srcElement.parentElement;
if (curobj.rowindex==0) return false;
try{
if (Curobj.children[0].children.length = = 0) return false;
}
catch (Err) {
return false;
}
if (curobj.children[0].children[0].checked) {
curobj.children[0].children[0].checked = false;
}
else{
Lastobj = Curobj;
Lastcolor = "#FFFFFF";
Curobj.children[0].children[0].checked = true;
}
}
if (Event.srcElement.tagName = = "INPUT") {
try{
var curobj = event.srcElement.parentElement.parentElement;
if (curobj.rowindex==0) {
var obj = curObj.parentElement.parentElement;
for (i=1;i<obj.rows.length;i++) {
if (obj.rows (0). children[0].children[0].checked) {
Obj.rows (i). children[0].children[0].checked = true;
Obj.rows (i) style.backgroundcolor= "#FFFFFF";
Obj.rows (i) style.color= "#000000";
}
else{
Obj.rows (i). children[0].children[0].checked = false;
if (i%2==1) {
Obj.rows (i) style.backgroundcolor= "#FFFFFF";
Obj.rows (i) style.color= "#000000";
}
else{
Obj.rows (i) style.backgroundcolor= "#FFFFFF";
Obj.rows (i) style.color= "#000000";
}
}
}
}
}
catch (Err) {
return true;
}
}
}
function Domouseover () {
if (event.srcelement.tagname== "TD") {
var curobj = event.srcElement.parentElement;
if (curobj.rowindex==0) return false;
Curobj.style.backgroundcolor= "#F2FFEE";
}
if (event.srcelement.tagname== "INPUT") {
var curobj = event.srcElement.parentElement.parentElement;
if (curobj.rowindex==0) return false;
Curobj.style.backgroundcolor= "#F2FFEE";
}
}
function Domouseout () {
if (event.srcelement.tagname== "TD") {
var curobj = event.srcElement.parentElement;
if (curobj.rowindex==0) return false;
try{
if (Curobj.children[0].children.length = = 0) {
if (curobj.rowindex%2==1) {
Curobj.style.backgroundcolor= "#FFFFFF";
Curobj.style.color= "#000000";
}
else{
Curobj.style.backgroundcolor= "#FFFFFF";
Curobj.style.color= "#000000";
}
return true;
}
}
catch (Err) {
if (curobj.rowindex%2==1) {
Curobj.style.backgroundcolor= "#FFFFFF";
Curobj.style.color= "#000000";
}
else{
Curobj.style.backgroundcolor= "#FFFFFF";
Curobj.style.color= "#000000";
}
return true;
}
if (curobj.rowindex%2==1)
if (curobj.children[0].children[0].checked) {
Curobj.style.backgroundcolor= "#FFFFFF";
Curobj.style.color= "#000000";
}
else{
Curobj.style.backgroundcolor= "#FFFFFF";
Curobj.style.color= "#000000";
}
Else
if (curobj.children[0].children[0].checked) {
Curobj.style.backgroundcolor= "#FFFFFF";
Curobj.style.color= "#000000";
}
else{
Curobj.style.backgroundcolor= "#FFFFFF";
Curobj.style.color= "#000000";
}
}
if (event.srcelement.tagname== "INPUT") {
var curobj = event.srcElement.parentElement.parentElement;
if (curobj.rowindex==0) return false;
try{
if (curobj.rowindex%2==1) {
if (curobj.children[0].children[0].checked) {
Curobj.style.backgroundcolor= "#FFFFFF";
Curobj.style.color= "#000000";
}
else{
Curobj.style.backgroundcolor= "#FFFFFF";
Curobj.style.color= "#000000";
}
}
else{
if (curobj.children[0].children[0].checked) {
Curobj.style.backgroundcolor= "#FFFFFF";
Curobj.style.color= "#000000";
}
else{
Curobj.style.backgroundcolor= "#FFFFFF";
Curobj.style.color= "#000000";
}
}
}
catch (Err) {
return true;
}
}
}
</SCRIPT>