Multi-value (one-to-many) support for checkbox field type
Multi-value (one-to-many) support for checkbox field type
Does the checkbox field type support multiple values? If so, what should my data look like and how should I implement the editor field?
Here is what my data looks like:
"data": [
{
"dashboards": [
{
"id": "101",
"name": "Dashboard 2",
},
{
"id": "100",
"name": "Dashboard 1",
}
],
"description": "this is a test",
"id": "3900",
"linkOrder": "1",
"newWindow": "false",
"text": "Test",
"url": "www.google.com",
}
]
Here is my field implementation:
{
label: "Dashboard(s)",
name: "dashboards",
data: "dashboards",
type: "checkbox",
options: [
{name: "Dashboard 1", id: 100},
{name: "Dashboard 2", id: 101}
],
optionsPair: {label: "name", value: "id"}
},
Since my source object belongs to two dashboards, I would expect both checkboxes to be checked when I edit the record. However, none are checked. Is this even possible?
Thanks,
Kurt
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Took a while to find it but I figured it out from this example.
It doesn't explicitly support multiple values for an individual entry (i.e. a single checkbox has multiple object properties). I have a sneaky feeling it might actually work, but it isn't something tested for.
Allan
It actually worked perfectly!
Thanks!