Editor - Add Checkbox

Editor - Add Checkbox

dpanscikdpanscik Posts: 121Questions: 32Answers: 0

I'm trying to add a checkbox to a column. However this has no effect

The following "type": "checkbox", has no effect.

Here is my code for editor

   editor = new $.fn.dataTable.Editor({
            ajax: '/api/APData',
            table: "#ApForm",
            "data": function (d) {
                return $.extend({}, d, {
                    "form_id": "APgrid",
                });

            },
   
            formOptions: {
                inline: {
                    submit: 'allIfChanged',
                },
            },
            fields: [
                {
                    label: "PH",
                    name: "pinkHighlight",
                    type: "checkbox",
                },
                {
                    label: "YH",
                    name: "yellowHighlight",
                    type: "checkbox",
                },

            ]

Here is my code for datatable

           "columnDefs":
                [

                    { "defaultContent": "-", "targets": "_all" },

                    {
                        "targets": [12],
                        "visible": true,
                        "orderable": true,
                        "type": "checkbox",

                    },
                    {
                        "targets": [13],
                        "visible": true,
                        "orderable": true,
                        "type": "checkbox",

                    },


                ],

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.