Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3740

many to many options for editable field

$
0
0

Hi

I have the following use case:

users table: it contains users related data but not role_id
roles table: it contains roles related data
role_user pivot table: it contains role_id and user_id ... it is used to let users have multiple roles

then i have a Datatable with an Editor with a column Publisher
i need in that column to display the Publisher name and when i click on it i need a select with all publishers in the db: so i need to get all users with the publisher role from the db

this is the field setup i am trying to adapt:

Field::inst( 'items.publisher_id' )->options(
Options::inst()
->table( 'users' )
->value( 'id' )
->label( 'name' )
)->validator( 'Validate::dbValues', array( 'valid' => array('') ) ),

i literally have no idea how to adapt it :(

thanks


Viewing all articles
Browse latest Browse all 3740

Trending Articles