Reputation: 1301
cannot find a way to connect two component together. I have table in first component, and need to get the list from second and show it as drop down list. Any chance I can do it? Thanks
P.s. forget to mention. I need to get a list in back end.
Upvotes: 1
Views: 140
Reputation: 75
You can use getOptions()
method:
public function defineProperties()
{
return [
'country' => [
'title' => 'Country',
'type' => 'dropdown',
'default' => 'us'
]
];
}
public function getCountryOptions()
{
// here you can use DB or Model
return ['us'=>'United states', 'ca'=>'Canada'];
}
Upvotes: 1