Editor dependent on hidden field always empty value

Editor dependent on hidden field always empty value

yu yen kanyu yen kan Posts: 65Questions: 31Answers: 0

in my editor I declared

var editor = new $.fn.dataTable.Editor({
            table: "#" + tableName,
            ajax: {
                create: "",
                edit: {
                    url: "",
                    type: "PUT"
                },
                remove: {
                    url: "",
                    type: "DELETE"
                }
            },
            idSrc:  'id',
            fields: [{
                    name: "id",
                    type: "hidden",
                    def: id
                }, {
                    name: "data",
                    type: "select"
                }]
        });

and dependent of editor

        editor.dependent(id', function (val) {
            if (val === "") {
alert("no value");
            } else {
                var data = GetDataList(val);
                requestEditor.field('data').update(data);

            }
        });

when I change the type of id to text, then it work well.

This discussion has been closed.