Editor: How to pass select label to update method?
Editor: How to pass select label to update method?
joakim-m
Posts: 5Questions: 3Answers: 0
In my Persons table I have a column like this
"columns": [
{ "data": "compName" },
and this field in Editor
fields: [
{
label: 'Company',
name: 'compID',
type: 'select',
optionsPair: {
label: 'compName',
value: 'compID'
}
},
The select field is populated thus:
$.getJSON("companies.json", function (data) {
editor.field('compID').update(data);
});
When editor sends ajax it wants new row data in return.
My updatePerson() method already knows the compID (passed as data[compID]).
Can the newly selected compName be passed the same way?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Got it:
However, this is not the proper way to do joins. Here's the manual entry on Join tables - working with multiple SQL tables
You could use the public API with a bit of jQuery to do it:
Using
field().input()
.Allan