zoukankan      html  css  js  c++  java
  • js 操作gridview

    使用javascript操作GridView(获取当前行的值)

    function getIt(obj) {
    var r,c
    o = obj

    while(o.tagName != "TD" && o.tagName != "TH")
    o = o.parentNode
    if(o.tagName != "TD" && o.tagName != "TH") return
    c = o.cellIndex
    while(o.tagName != "TR")
    o = o.parentNode
    if(o.tagName != "TR") return
    r = o.rowIndex

    //下面的代码是取gridview模板列中控件的内容
    //document.getElementById("grid1").rows[r].cells[0].innerText可以求网格单元的内容
    document.getElementById("grid1").rows[r].cells[0].firstChild.value="";
    document.getElementById("grid1").rows[r].cells[1].firstChild.value="";
    document.getElementById("grid1").rows[r].cells[2].firstChild.value="";

  • 相关阅读:
    http返回码
    WCF 超时
    MVC异步
    熔断设计模式
    JAVA学习图
    java io模型
    keep alive 长连接
    Java异常处理 误区
    架构的本质
    Repository模式
  • 原文地址:https://www.cnblogs.com/sherry/p/1281355.html
Copyright © 2011-2022 走看看