MJoin - "Unknown Field" on Search & Order
MJoin - "Unknown Field" on Search & Order
Hi guys,
did I miss anything? Can't get a simple Mjoin table to work. Display and Editor works fine, but I cannot order or search the mjoin column. It says "Unknown field: employee".
JS
{
data: "employee",
render: "[, ].lastname"
}
PHP
->join(
Mjoin::inst( 'employee' )
->link( 'customer.id', 'customer_employee.customer_id' )
->link( 'employee.id', 'customer_employee.employee_id' )
->order( 'employee.lastname asc' )
->fields(
Field::inst( 'id' )
->options( 'employee', 'id', 'lastname' ),
Field::inst( 'lastname' )
)
)
Any help would be great!
Cheers
Hannes
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Unfortunately there is no option to search and order the Mjoin fields at the moment You have to use
columns.searchable
andcolumns.orderable
to stop them from triggering this error.Allan
Ok, no problem!
My workaround fyi: I deactivated sortable and searchable and made a custom search field. Think this is even better for the user.
HTML
JS
PHP
Cheers
Hannes