There's a newer version of appendGrid!
Unique Index

In order to identify each rows in append grid, there is a unique identifier named `uniqueIndex` is assigned to every row once they are created. Since rows can be moved up or down, the row index is not a good idea to identify each row uniquely. So, there is a JavaScript array named `rowOrder` for keeping uniqueIndex in sequence.

For example, assume there are three rows in appendGrid. When clicking on the insert button at row 2, a new row with uniqueIndex=4 is inserted above it.

UniqueIndex

After that, remove that last row that having uniqueIndex=3 and click on append button. A new row with uniqueIndex=5 is appended. This uniqueIndex will not be reset until appendGrid recreated.

UniqueIndex

The value of rowOrder is [1,4,2,5] finally. Once this form with appendGrid data submitted, the server-side application such as ASP.NET/PHP/JSP can split the rowOrder value and save to database in sequence.

Please try the following example to see the relationship between rowIndex, uniqueIndex and rowOrder.

RowOrder: