Checkbox Not Working

Checkbox Not Working

gunseligunseli Posts: 14Questions: 8Answers: 0

Hi,

There is no change in the database when I check the checkbox.

Controller: .Field(new Field("Offer"))


      {
                    label: "Offer",
                    name: "Offer",
                    type: "checkbox",
                     separator: "|",
                   options: [
                 { label: "", value: "1" }
                    ],
          },

   { 
                    data: "Offer",
                    className: 'text-left font-bold',
                    title: 'Offer',
                    render: function (data, type, row) {
             if ( type === 'display' ) {
                    return '<input type="checkbox" class="editor-offer">';
                }
                return data;

                    }

$('#' + tableId).on('change', 'input.editor-offer', function () {

    editor
        .edit($(this).closest('tr'), false)
        .set('Offer', $(this).prop('checked') ? 1 : 0)
        .submit();
} );

Answers

  • kthorngrenkthorngren Posts: 21,172Questions: 26Answers: 4,923

    There's lots of places where the problem could be. What troubleshooting steps have you taken? I would look at the following:

    • Make sure the click event is executing
    • Look fro errors in the browser's console
    • Check the Ajax request sent and the response in the browser's developer tools
    • Debug the server script to see if there is an error or what its doing with the Ajax request

    Kevin

This discussion has been closed.