Recalculate footer info after row().remove

Recalculate footer info after row().remove

llameadrpcllameadrpc Posts: 4Questions: 1Answers: 0

Using DT 1.10 API, how do I recalculate the footer info ('Showing 1 to 3 of 3 entries') after row().remove) A table.draw() just restores the removed rows.

This question has an accepted answers - jump to answer

Answers

  • llameadrpcllameadrpc Posts: 4Questions: 1Answers: 0

    Note: the number of rows as shown in the debugger is not decreasing with row().remove either.

  • DaimianDaimian Posts: 62Questions: 1Answers: 15

    Here is a test case that works, not sure what your issue is. If this doesn't help you will likely need to give us more info or a test case.

    Note: The "remove" button at the bottom.

  • llameadrpcllameadrpc Posts: 4Questions: 1Answers: 0

    Link, please?

  • DaimianDaimian Posts: 62Questions: 1Answers: 15
    Answer ✓

    Wow, I'm really spaced out today :)
    http://live.datatables.net/powakim/1/edit

  • llameadrpcllameadrpc Posts: 4Questions: 1Answers: 0

    Thanks.

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    @llameadrpc - sounds a lot like you are using server-side processing (but without either a test case, or a debug trace, as required in the forum rules) it is impossible to say.

    If you are using server-side processing, then you need to delete the data at the data source (i.e. the server). Using a client-side method to remove the row isn't going to work.

    Allan

  • DaimianDaimian Posts: 62Questions: 1Answers: 15

    Allan, I figured there was another issue going on because even with server-side the draw() wouldn't restore data that was deleted with row().remove() unless he is calling ajax.reload() somewhere?

    Allan is right, you really need to helps us help you on this one.

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    A simple draw() would "restore" the row. I quote "restore" because it was never removed from the data source. In server-side processing mode, DataTables is just a dumb display and event manager - deleting the data on the client-side makes no difference since the server doesn't know that this has happened.

    Allan

This discussion has been closed.