DataTables Inline Editor select does not select current value or submit first value
DataTables Inline Editor select does not select current value or submit first value
![finsight-ak](https://secure.gravatar.com/avatar/65d2e333f126014905681b56e50c894d/?default=https%3A%2F%2Fvanillicon.com%2F65d2e333f126014905681b56e50c894d_200.png&rating=g&size=120)
datatable has keys inline editor option
keys: {
editor: editor
},
editor has submit (and works fine mostly)
formOptions: {
inline: {
onBlur: 'submit',
}
},
...
{
label: "MissingDNA",
name: "MissingDNA",
type: "select",
options: [
{ label: "unknown", value: "" },
{ label: "true", value: "true" },
{ label: "false", value: "false" },
],
def: ""
},
the current value is displayed in the table, but when the inline edit is initiated, the selected in the select list is always the top value (not the current value). It does not matter if I do not define a default, or change the order of the options. The first option is always selected, and with this field (MissingDNA in this example) selecting the top option does not submit, no matter the current value.
same editor and this field works OK--including the fact that the current value is selected when inline edit is initiated:
{
label: "Species",
name: "Species",
type: "select",
options: [
{ label: "MAN", value: "4" },
{ label: "BEAST", value: "5" }
]
},
I do not see a way to post an editor example in live.datatables.net
This question has an accepted answers - jump to answer
Answers
this has SAME symptoms
That suggests that the value of the "MyFlag" field is not a string with the value of
true
orfalse
.Can you show us the JSON you are using please?
Allan
Same symptoms, after some mods. I updated the js to use values, rather than strings:
But still no love on edit:
The JSON:
Could you give me a link to the page showing the issue please? This should work correctly in Editor and I'd like to debug what is happening.
Allan
The page is for a client, and is not publicly accessible.
allan,
sent you a private message with a datatables live link. there you will find a datatables live that demonstrates the problem--I have disconnected calling my server ajax for update, but notice the incorrect selection on true/false columns. Please advise.
Update this live datatable with EDITOR references for css and js:
http://live.datatables.net/wumagoha/1/edit?html,css,js,output
to duplicate with simplified js and data
Hi,
Awesome - thank you for the link.
This is indeed a bug in Editor. It will correctly handle booleans for radio and checkboxes, but not for select elements unfortunately.
I have the fix locally and can send you a copy of the file with the fix if you like. Should I use the e-mail address shown in your user name? Btw - do you want me to change your user name - a publicly visible e-mail address is a sure fire way of attracting spam!
Regards,
Allan
Yes allan please do both!
Please advise when 1.5.3-dev pushed to production?
thank you, again!
By the end of the month.
Allan