繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> ASP基础 >> 一个改变最后选中datagrid的Color的javascript

一个改变最后选中datagrid的Color的javascript

2006-07-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:var Supplier_LastSelectRowId = ""; function Supplier_selectRow(sender) { if(Supplier_LastSelectRowId != "") { var lastSelectRow = window.document.getElementById(Supplier_LastSelectRowId); if (last...

var Supplier_LastSelectRowId = "";

function Supplier_selectRow(sender)

{ if(Supplier_LastSelectRowId != "") { var lastSelectRow = window.document.getElementById(Supplier_LastSelectRowId); if (lastSelectRow != null) { lastSelectRow.runtimeStyle.backgroundColor = ""; } } var selectRow = Supplier_GetParentElementByTagName(sender, "TR"); //window.document.getElementById(sender.id); if (selectRow != null) { selectRow.runtimeStyle.backgroundColor = "#CAD3E4"; Supplier_LastSelectRowId = selectRow.id; //sender.id; //SupplierName.innerHTML = sender.innerHTML; } }

function Supplier_GetParentElementByTagName(element, tagName) { var element=element; while(element.tagName != tagName) element = element.parentNode; return element; }

责任编辑:admin
相关文章