小编Ham*_*lue的帖子

jQuery数据表,删除行,添加行和编辑行问题

我有一个表,我想添加,删除和编辑行.添加效果很好,但编辑和删除工作不正常.当我删除某些行时有时我无法保存我在第一行或最后一行编辑的内容和/或行的输入字段不会显示.

我用:数据表和快捷方式.

HTML部分:

<td><img id ="addButton" src="../images/add_up.png" onmouseover="this.src='../images/add_over.png'" onmouseout="this.src='../images/add_up.png'" onclick="this.src='../images/add_down.png'" /></td>
<table class="display" id="example" onclick=editRow(this.id, nRow);>
    <thead>
        <tr>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
        </tr>
    </thead>
    <tbody></tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

js部分:

function restoreRow(oTable, nRow) {
    var aData = oTable.fnGetData(nRow);
    var jqTds = $('>td', nRow);
    for (var i = 0, iLen = jqTds.length; i < iLen; i++) {
        oTable.fnUpdate(aData[i], nRow, i, false);
    }
    oTable.fnDraw();
}

function editRow(oTable, nRow) {
    var aData = oTable.fnGetData(nRow);
    var nummer = tabellenInhaltsDaten.length;


    var acctualRowIndex = nRow.rowIndex - 1; …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery jquery-datatables

7
推荐指数
0
解决办法
1万
查看次数

标签 统计

html ×1

javascript ×1

jquery ×1

jquery-datatables ×1