how to diplay data from mysql field as a checkbox in datatables

how to diplay data from mysql field as a checkbox in datatables

cinloicinloi Posts: 3Questions: 1Answers: 0

I was searching around the forums about my question but doesn't find any information that provided for a newbie like me :)

There are 2 things that I want to ask from this forums about checkboxes function using datatables:

  1. One of my mysql database field is using value "1" and "0" and I want to display it using datatables as a checkbox function on the table list. Can I do this for my mysql table? Can it do an update to database when the user click the checkbox ?

  2. Can I show the checkbox using the modal form? how to update the database using modal form with the checkbox field?

thanks

Answers

  • Tom (DataTables)Tom (DataTables) Posts: 139Questions: 0Answers: 26

    There's an example of how to do this with editor here. Even if you don't want to use Editor the same principles still apply. Use a renderer to display the checkbox and use an event listener to update the changes.

    Thanks

    Tom

  • cinloicinloi Posts: 3Questions: 1Answers: 0
    edited July 2016

    hi Tom, thanks for your answers.

    The example that you refer is the table list that I'm looking for.
    But, I am really new in this datatables function and I still don't know how to do that

    I use this website ( http://mbahcoding.com/php/codeigniter/codeigniter-ajax-crud-modal-server-side-validation.html ) as my tutorial. The code working great until I want use a checkbox in the table list and in the modal form.

    Maybe you can refer me to the blog or website or other things to show me the tutorial steps how to use the checkbox in the table list and in the modal form.

    sorry for my "newbie" skill :(

    thanks

This discussion has been closed.