且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将行动态添加到表中

更新时间:2023-11-30 22:33:34

' #Field tr')。length; // 首先我取当前的tr数。
这里' 字段'是我的表ID。
然后使用以下代码我在当前行下面添加一行。
('#Field tr').length;//first i take the current number of tr. Here 'Field' is my table id. then using the following code i append one row below the current row.


' 。AddTableRowForm')。append( // 在此我指定了所有控件在每一行上添加。)
('.AddTableRowForm').append(//Inside this i specified all controls which are added on each row.)



输出:

附加一行指定的控件。



实际输出:

在当前行下方添加两行。



谢谢&问候,

Anupama


Ouput:
appended one row with specified controls.

Actual Output:
Append two rows below the current row.

Thanks& Regards,
Anupama


您正在使用的append语句在表中附加一行。所以很多时候你写这个语句会把很多行附加到你的表中。

因为在你的情况下你有2个这样的行,只需写两次append语句:

The append statement you are using appends a row to the table. So as many times you write that statement it will append that many rows to your table.
Since in your case you 2 such rows, just write the append statement two times: