Checkbox requires two clicks to be checked/unchecked

Checkbox requires two clicks to be checked/unchecked

mak1mak1 Posts: 25Questions: 13Answers: 1

Hi Allan,

I have a strange issue where checkboxes require two clicks to be checked.
I followed the example here
https://editor.datatables.net/examples/api/checkbox.html

however I'm using bootstrap instead of datatables.

So a column is

                { data: 'Holder',title: 'Holder'     ,          render: function ( data, type, row ) {
                            if ( type === 'display' ) {
                                return '<input type="checkbox" class="p_holder">';
                            }
                            return data;
                        },
                        className: "text-center" }

and rowCallback is

                rowCallback: function ( row, data ) {
                    // Set the checked state of the checkbox in the table
                    $('input.p_holder', row).prop( 'checked', data.Holder== true );
                }

and editor is


{ label: 'Holder:", name: "Holder", type: "checkbox", separator: "|", options: [ { label: '', value: true } ] }

After the 2nd click on the checkbox it selects or unselects the box, any ideas?

This question has an accepted answers - jump to answer

Answers

  • mak1mak1 Posts: 25Questions: 13Answers: 1
    Answer ✓

    Nevermind, I had an extra

        // Activate an inline edit on click of a table cell
         $('#table').on( 'click', 'tbody td', function (e) {
            editor.inline( this, {
                onBlur: 'submit'
            } );
        } );
    

    from the inline edit example which was causing the double click issue

This discussion has been closed.