Add row to top of the table rows
Add row to top of the table rows
I wanna add some editability to DataTables. In the interface in our design, users are supposed to click a "Add new record" item when they want to add one. In our design, no matter how a user sorts a table, the row added is supposed to always appear at the first row, so the user knows a row is added when he clicks the button. And afterward, he can click the row and edit it in-place.
The users can add several rows at a time, and the newly added data won't be submitted to the server-side unless the "Submit changes" button is clicked.
The first problem here is fnAddData does not do the job since there's no means to add the row to the top.
The second problem is to bypass the sorting when a new row is added.
The third problem is to identify those newly added rows, and post the data back to the server.
Is it possible to achieve this?
The data source is a JSON array pulled from a database server.
The users can add several rows at a time, and the newly added data won't be submitted to the server-side unless the "Submit changes" button is clicked.
The first problem here is fnAddData does not do the job since there's no means to add the row to the top.
The second problem is to bypass the sorting when a new row is added.
The third problem is to identify those newly added rows, and post the data back to the server.
Is it possible to achieve this?
The data source is a JSON array pulled from a database server.
This discussion has been closed.
Replies
2. See above.
3. fnAddData (will return and array of the internal cache indexes of the rows which has been added). This can be used to get the data - although you already have this at the point of adding the row, so this might not be needed.
Allan