3 Tables SearchPanes - Cascade panes

3 Tables SearchPanes - Cascade panes

TimmKTimmK Posts: 1Questions: 1Answers: 0

Description of problem: Hey, I want to use the SearchPanes - Cascade panes (https://editor.datatables.net/examples/extensions/searchPanesCascade.html) and the following scenario: I have Table_A, Table_B, and Table_C. The data from Table_C should be displayed in the output. Table_C also contains TableA_id and TableB_id. Table_B also has TableA_id. I want to use cascading Search Pans to filter from Table_A (searchPane1) to Table_B (searchPane2), and then Table_B should output all the data from Table_C(searchPane3). The Table shoud below the SearchPanes shoud show all Data from TableC. Here is what I tried, but it did not work:

Editor::inst($db, 'TabelleC')
->field(
Field::inst('TabelleC.name')
->searchPaneOptions(SearchPaneOptions::inst()
->value('TabelleC.name')
->label('TabelleC Name')
),
Field::inst('TabelleA.name')
->options(Options::inst()
->table('TabelleA')
->value('id')
->label('name')
)
->searchPaneOptions(SearchPaneOptions::inst()
->leftJoin('TabelleA', 'TabelleA.id', '=', 'TabelleC.TabelleA_id')
->value('TabelleA.name')
->label('TabelleA Name')
),
Field::inst('TabelleB.name')
->options(Options::inst()
->table('TabelleB')
->value('id')
->label('name')
)
->searchPaneOptions(SearchPaneOptions::inst()
->leftJoin('TabelleB', 'TabelleB.id', '=', 'TabelleC.TabelleB_id')
->label('TabelleB Name')
)
)
->leftJoin('TabelleA', 'TabelleA.id', '=', 'TabelleC.TabelleA_id')
->leftJoin('TabelleB', 'TabelleB.id', '=', 'TabelleC.TabelleB_id')
->debug(true)
->process($_POST)
->json();

Thanks for your help!

Sign In or Register to comment.