inline edit of a field is also submitting all the select fields (with null values)
inline edit of a field is also submitting all the select fields (with null values)
inline edit submit of any field is also submitting all the select fields with first available options
editor = new $.fn.dataTable.Editor( {
table: "#table",
fields: [
{
label: "Style No",
name: "styleNo",
type: "text"
},
{
label: "Ax Colour",
name: "axColour",
type: "select",
options: [
{ label: "One Color", value: "00" },
{ label: "White", value: "01" },
]
},
ajax: function (method, url, d, successCallback, errorCallback) {
console.log(d.data);
if ( d.action === 'edit' ) {
/code to update
}
},
});
$.fn.dataTableInstance[0] = $("#table").DataTable( {ajax: {
url: "${purchaseOrderServiceUrl}orderLineItems?orderId=${orderId}",
type: "GET",
},
columns: [
{ data: "styleNo"},
{ data: "axColour"},
]
});
when i change the styleNo, axColour field is also submitted if the value of the field was null .
This question has an accepted answers - jump to answer
Answers
That suggests that the other fields (the
select
fields) don't have a value in their list of options that matches the value for the row. Theselect
will take the first value in the select list if it doesn't have the value given to it (the same way that an HTMLselect
works.Allan
thanks allan, the Initial value of the field is null, and i tried to add one more option with null values
{ label: null, value: null },
but still same behaviour
Can you link to the page showing the issue so I can take a look please?
Thanks,
Allan
thanks Allan, unfortunately i do not have public domain to share , but i did a work around and gave always default value to field