Left join options
Left join options
modyking55
Posts: 14Questions: 7Answers: 0
->options( Options::inst()
->table( 'sites' )
->value( 'id' )
->label( 'name' )
),
can i add join at options that for ex that name col joined with another table for name for mulilanguage
how can i access options response from server_side and client side
This discussion has been closed.
Answers
Hi,
Currently there isn't an option to left join from the
Options
class I'm afraid. You need to use a custom function to get the options, with a query to the database to get the joined data.One other option is to create a VIEW in your database for the join query, then the
Options
class can read that just like it was any other table.Allan
ok but
how can i access options response from server_side and client side
to reuse the reponse like at dependency
I'm afraid I don't understand. If you create a VIEW for your joined data, the
Options
class would operate exactly as normal.Allan
for example if i want to get array of data you return it at many functions so i can use it if i want to read the response of option there any way to do it
like
options['tablename.col']
If you want to inject values (options) into the
options
property of the JSON that is returned to the client-side, you'd use a custom function for theField->options()
like in the example in the link I gave above.Allan