when user clicks on the custom checkbox, the check symbol is not populating. Please guide me.

when user clicks on the custom checkbox, the check symbol is not populating. Please guide me.

Goutham.knGoutham.kn Posts: 13Questions: 5Answers: 0
edited October 2018 in Free community support
columns: [{
                    className: 'select_row',
                    //data: null,
                    defaultContent: "",
                    render: function ( data, type, row ) {
                     if ( type === 'display' ) {
                    return '<div class="custom-control custom-checkbox">' +
                    '<input type="checkbox" class="editor-active custom-control-input" id="'+row.DT_RowId+'"/>' +
                    '<label class="custom-control-label" htmlFor="'+row.DT_RowId+'"></label>' +'</div>';
                    }
                    return data;
                    }
                },

This question has accepted answers - jump to:

Answers

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

    Hi @Goutham.kn ,

    We're happy to take a look. As per the forum rules, if you could link to a running test case showing the issue we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • Goutham.knGoutham.kn Posts: 13Questions: 5Answers: 0

    https://datatables.net/extensions/select/examples/initialisation/checkbox

    I have used the logic of the above example. Its working fine but i need to override the checkbox (check mark or symbol) to be a normal checkbox(check mark or symbol). please guide me

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin
    Answer ✓

    By "normal" do you mean a <input type="checkbox"> element? If so, then that is not something that Select currently supports. It is something you could develop using a customer renderer to create the checkbox and then use the Select API to trigger the row selection based on the state of the checkbox.

    Allan

  • Goutham.knGoutham.kn Posts: 13Questions: 5Answers: 0

    Thanks for providing the solution.

  • Goutham.knGoutham.kn Posts: 13Questions: 5Answers: 0

    Thanks for providing the solution.

This discussion has been closed.