Checkbox doesn't hold value

Checkbox doesn't hold value

amweiss98amweiss98 Posts: 12Questions: 4Answers: 1

I'm using the Always Shown Checkbox example..but while sometimes it will send data successfully to the server, it never shows the checkbox is checked. Here is a working example:

https://usc.thrivezone.org/z2.php

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,322Questions: 26Answers: 4,774

    Looks like you need to disable inline editing for that column.

    Change the selector for this:

        $('#example').on( 'click', 'tbody td:not(:first-child)', function (e) {
            editor.inline( this );
        } );
    

    To this:
    'tbody td:not(:first-child), :nth-child(4)'

    I think that should help.

    Kevin

  • amweiss98amweiss98 Posts: 12Questions: 4Answers: 1

    thanks..ok..I just did that..but now 2 things are still not working...first, when you check off 1 box and then move to another it unchecks the first box...second, it only sometimes works to add the data to the database, third, if you refresh the page after checking some off, the checkboxes all go to unchecked.

  • kthorngrenkthorngren Posts: 20,322Questions: 26Answers: 4,774

    It still looks like the inline editor is being invoked (when the box moves). I may have mis-counted the columns. Try :nt-child(3) instead.

    Kevin

  • amweiss98amweiss98 Posts: 12Questions: 4Answers: 1

    Well, I wish worked, but it still has the same problems.

  • kthorngrenkthorngren Posts: 20,322Questions: 26Answers: 4,774
    Answer ✓

    I missed it the first time but you aren't submitting the inline changes. Try changing to this:

        $('#example').on( 'click', 'tbody td:not(:first-child),:nth-child(4)', function (e) {
            editor.inline( this, {
                  onBlur: 'submit'
            } );
        } );
    

    Looks like the column should be 4 :-)

    Kevin

  • amweiss98amweiss98 Posts: 12Questions: 4Answers: 1

    ok...for this work it looks like this disabling selector needs to look like this

    'tbody td:not(:first-child):not(:nth-child(4))'

This discussion has been closed.