How to make condition button on column.render?

How to make condition button on column.render?

erandraerandra Posts: 5Questions: 1Answers: 0

This is my php code wich i want to change to javascript using datatable

and this is my code javascript using datatable

I want make condition button like on php..
Please Help me..

Thanks

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    This example should help, it's doing just that.

    Colin

  • erandraerandra Posts: 5Questions: 1Answers: 0

    @colin I just confuse how to get data from database then use it to make condition like on last <td> on php. I want get data from database then use it on column.render.
    on your example, the condition happen when the button clicked.
    But, i want the condition happen when i'm not doing anything. just check from database.
    if there's no data, the button will set btn-danger else set btn-success.
    Please help i'm newbie.

    Thanks

This discussion has been closed.