bug appears on add a new row

bug appears on add a new row

elgarchelgarch Posts: 13Questions: 0Answers: 0
edited April 2012 in General
Hello,

The first time when i click on add new row, it shows and works perfectly, but when i try to sort by columns and then i click on add new row the new line doens't appear, i think it's due to the sort action.

Is there any way to force the datatables to show always the new added line on top of the table even we sorted the table before ?

Thanks in advance

Replies

  • elgarchelgarch Posts: 13Questions: 0Answers: 0
    any suggestion, i don't know how to solve that problem.

    Thanks a lot
  • allanallan Posts: 63,810Questions: 1Answers: 10,516 Site admin
    > Is there any way to force the datatables to show always the new added line on top of the table even we sorted the table before ?

    No - if the data in your new row makes the row be sorted to the back to the table, that is where it would go - not to the top. The sorting order is not broken for the new row.

    One option to overcome this might be to fuse the http://datatables.net/plug-ins/api#fnAddDataAndDisplay plug-in for DataTables.

    Allan
  • elgarchelgarch Posts: 13Questions: 0Answers: 0
    edited April 2012
    Thanks Alan for your response,

    well, i prefered to do that with jQuery, i added a new row and when clicking on save i get back data then i remove the temporary row and finally i create a new row with the data recovered.

    Thanks a lot
This discussion has been closed.