网站首页  |  幼儿教育  |  中小学教育  |  电脑教育  |  英语教育  |  教育论文  |  家长教育 设为首页加入收藏联系投稿 
 位置: 中国教育学习网 > 电脑教育 > WEB开发 > JavaScript > 正文

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

字号:   


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; }

收藏此文  |  打印  

 
  • 上一篇教程:

  • 下一篇教程:

  •   GoogLe
     
      最新推荐

      最近更新

      GoogLe

     
    Powered by Cn-Education.Com (c) 2005-2008 中国教育学习网 教育网站长QQ交流群60041790
    设为首页  |  加入收藏  |  版权申明  |  广告服务  |  联系我们  |  友情链接  |  网站地图  |  返回顶部 ↑