Hiding rows in the dataTable

Hiding rows in the dataTable

AlexanderLamasAlexanderLamas Posts: 58Questions: 1Answers: 0

Hi guys,

Is it possible to hide some rows in a DataTable, marking them as deleted somehow, so that, the user can not see these rows anymore, keep them hidden, and then, send them to the server to do the physical delete of the marked rows in the server side?

Thank you very much!

Regards,
Alex

Replies

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @AlexanderLamas ,

    It seems it would be worth considering Editor - that's all done for you. If you want to do it without Editor, you can use row().remove() to remove the row, then initiate an Ajax call to the server to remove from there.

    Cheers,

    Colin

  • AlexanderLamasAlexanderLamas Posts: 58Questions: 1Answers: 0
    edited April 2019

    Hi @colin ,

    Thank you very much for your reply.

    Yes, I'm actually using row().remove() to remove the row, but, it does remove completely from the table in the memory.

    I was just trying to somehow delete the rows logically, keep them hidden from the user, mark them as deleted and send to the server in my ajax call, and then I would delete the marked rows physically.

    Perhaps not the best solution, but, I'm adding the deleted row in a different object, then I send this object to the server as a parameter in my ajax call, and then I can delete this rows physically.

    Do you see any other way of achieving that not using the "Editor" API and not having to send another parameter in my ajax call? Is there any way I can mark and hide the removed rows?

    Thank you very much again!

    Regards,
    Alex

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @AlexanderLamas ,

    No, what you're doing is probably as good as it'll get without using Editor. This thread here has some code that's doing pretty much what you're after, but suspect you've done those steps already.

    Cheers,

    Colin

  • AlexanderLamasAlexanderLamas Posts: 58Questions: 1Answers: 0

    Hi @colin ;

    Thanks again for reply.

    I will stick to what I have done then.

    Thank you!

    Regards,
    Alex

This discussion has been closed.