`
tanglei198577
  • 浏览: 59942 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类

Add or delete lines of table by JS

阅读更多

When want to add a line or delete a line for detailed info for basic object ,we can use this:

function deleteRow(tableObjStr,saveNumber){
    var tableObj = document.getElementById(tableObjStr);
    var rowNum   = tableObj.rows.length-1;
    var count = 0;
    if(rowNum==1)  return alert("Cannot delete anymore!");
    for(var i=document.zzjcdForm.checkbox.length-1;i>=1;i--)
    {
      if(document.zzjcdForm.checkbox[i].checked)
      {
        count++;
        tableObj.deleteRow(i+1); 
       }
    }
     if(count==0)alert("Pls select the line u want to delete !");       
}

// add a line
function addRow(tableObjStr,tr0,trIdPrefix){
var tableObj = document.getElementById(tableObjStr);
var trNode     = document.getElementById(tr0);
var trObj    = trNode.cloneNode(true);
var rowNum   = eval(tableObj.lastChild.lastChild.id.substring(tableObj.lastChild.lastChild.id.indexOf(trIdPrefix)+trIdPrefix.length));
tableObj.lastChild.appendChild(trObj);
tableObj.lastChild.lastChild.id=trIdPrefix+(rowNum+1);
tableObj.lastChild.lastChild.style.display=""; 
}

 

分享到:
评论

相关推荐

    ImageMagick图片批量处理

    -endian type endianness (MSB or LSB) of the image -family name render text with this font family -fill color color to use when filling a graphic primitive -filter type use this filter when ...

    Knockout API 中文版

    Just represent your items as a JavaScript array, and then use a foreach binding to transform this array into a TABLE or set of DIVs. Whenever the array changes, the UI changes to match (you don’t ...

    WPTools.v6.29.1.Pro

    - fix of problem with table borders when also PageMirror was used. * change to DeleteMarkedChar. It now has additional parameter DeleteEmptyParAndTables : Boolean * change in unit WPWordConv to handle...

    Radmin自动登录器v3.0-多国语言绿色版-Release1-20150615

    * Delete :删除记录或目录(在记录窗格),或删除树状目录(在目录树窗格); * F1 :显示程序信息; * F2 :更名树状目录; * F3 :单条扫描(等待5秒,用于扫描网速较慢的记录); * F5 :全部扫描(多线程同时扫描...

    apktool documentation

    They are usually named with the naming of "resources", "res" or "framework". Example HTC has a framework called com.htc.resources.apk, LG has one called lge-res.apk After you find a framework file...

    Radmin自动登录器v3.0

    * Delete :删除记录或目录(在记录窗格),或删除树状目录(在目录树窗格); * F1 :显示程序信息; * F2 :更名树状目录; * F3 :单条扫描(等待5秒,用于扫描网速较慢的记录); * F5 :全部扫描(多线程同时扫描...

    常用常见 SQL语句语法 SQL语句语法, 合适需要入门的同学学习,很基础的内容,需要可以下载

    ALTER TABLE table_name ADD column_name datatype; ``` - **table_name**:要修改的表名。 - **column_name**:新增加的列名。 - **datatype**:列的数据类型。 删除列: ```sql ALTER TABLE table_name...

    cuteEditor6.0

    Apply security to control user access to resources <br/>Cute Editor allows developers to assign a pre-defined set of permissions by group or individual. This prevents a normal user ...

    MS-DOS 5.0

    If you have a partition created by WYSE DOS 2.11 or 3.1, you must delete the DOS partitions from your hard disk. See the procedure for repartitioning hard disks in Chapter 4 of the Microsoft MS-DOS ...

    MYSQL的常用命令和增删改查语句和数据类型.pdf

    LOAD DATA LOCAL INFILE 'data.csv' INTO TABLE students FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; ``` 备份数据库,可以使用`mysqldump`命令: ```bash mysqldump --opt school > school.bbb ``` ...

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持D4-XE5

    - fixed output of the check boxes on the highlighted lines in PDF export - fixed bug with PDF anchors - fixed bug when using two or more macroses in memo version 4.12 --------------- + added support ...

    R for beginner

    For more advanced customization, low-level plotting commands like `points()`, `lines()`, `text()`, and `polygon()` can be used to add elements to existing plots. ##### Graphical Parameters You can ...

    VB编程资源大全(英文源码 其它)

    rectangular or spherical gradient texts."<END><br>13 , sweepgl.zip This example greatly demonstrates how to use OpenGL in Visual Basic.<END><br>15 , drawdemo.zip This is an excellent example of ...

    BURNINTEST--硬件检测工具

    to prevent any toggling of these lines. Previously these where enabled, but not explicitly toggled. Release 5.3 build 1026 WIN32 release 17 July 2008 - Updated Level 2 and Level 3 CPU cache ...

    GIT2.33.0.2最新版本.zip

    * Preliminary clean-up of tests before the main reftable changes hits the codebase. * The backend for "diff -G/-S" has been updated to use pcre2 engine when available. * Use ".DELETE_ON_ERROR" ...

    Hive用户指南 Hive user guide 中文版

    [LINES TERMINATED BY line_terminator] [SERDE serde_type]] [STORED AS input_format output_format] [LOCATION hdfs_path] [TBLPROPERTIES (property_name=property_value,...)]; ``` - **基本例子**:创建...

    ansys计算实例借鉴.pdf

    - **几何属性**:在Real Constants > Add/Edit/Delete中定义模型的几何属性。 - **材料属性**:在Material Props > Material Models中设置材料的力学特性,如弹性模量和截面积。 2. **网格划分** - **设置网格...

    一本介绍ABAP的文档

    2. 访问内表:使用APPEND、INSERT、DELETE、READ TABLE等语句对内部表进行操作,获取、修改和删除记录。 3. 内部表的声明:声明内部表时需指定其类型,可以是标准表类型(如TYPE LINES OF)或自定义结构类型。 除了...

    简易SQL浏览器的开发 (1).pdf

    SQL.Add(Memo1.Lines.Text); Prepare; if Pos('select', Memo1.Lines.Text) <> 0 then Open else ExecSQL; end; dbgFind1.Refresh; except ShowMessage('执行错误查询'); end; end; end; ``` - **“上...

Global site tag (gtag.js) - Google Analytics