Search code examples
grocery-crud

grocery CRUD set_relation: how i do this?


from official grocery CRUD web, they teach me set_relation like that:
set_relation tutorial

The tutorial show how to display database which the main table (set_table) is "employees". But how do i display when my set_table is offices, so then one of my column consist of list of employees which work in the specific office.

Thanks.


Solution

  • In this case you will use callback_column and put inside the login to query the list of employees, loop through then , generating the HTML and returning it in the callback.

    Take a look at the callback_column documentation http://www.grocerycrud.com/documentation/options_functions/callback_column