Selected option in in-cell select dropdown
Selected option in in-cell select dropdown
Is it possible to add attribute to option in select dropdown?
I need to set selected option so default is not always first option
https://editor.datatables.net/reference/field/select
editor.add( {
type: "select",
label: "Locations:",
name: "locations",
options: [
{ label: "Edinburgh", value: 51 },
{ label: "London", value: 76, selected: true} // Something like this
]
} );
This discussion has been closed.
Answers
There's not a configuration option, but you could use the
initCreate
to set the default, with this code:See example here: http://live.datatables.net/pogofije/1/edit
Colin