field.types option override
field.types option override
I have a field in Editor that is being populated by a mysql db. I'm using the leftJoin method to get to the table. I'm displaying it as a radio button. There are 8 options supplied from the DB, but I only wish to display a select 4 of them. However, doing this does override and all 8 are still displayed:
{
label: "My options:",
name: "MYTABLE.foreignkey_id",
type: "radio",
options:[
{ label: "1", value: "1" },
{ label: "2", value: "2" },
{ label: "6", value: "6" },
{ label: "8", value: "8" }
]
}
Is there any way to display only a certain selection of all possible values in the database?
This discussion has been closed.
Answers
The Options class has a
where
method which can be used to limit the results. I presume that there is so logic to which values shouldn't be shown and a where condition could be applied for that? If not then there is thelimit
method which could be used instead.Allan