Table Join
Allows you to join other tables. Only INNER JOIN supported. Keys in all joined tables must exist and be unique.
public function table_join()
{
$xcrud = get_xcrud();
$xcrud->table('employees');
$xcrud->join('officeCode','offices','officeCode'); // ... INNER JOIN offices ON employees.officeCode = offices.officeCode ...
//this line loads the <script> below it from a view
$data['script'] = view('scripts', ['code' => 'table_join']);
<script>
$(document).ready(function() {
$(".xcrud-list").tableHeadFixer({"head" : false, "left" : 2});
});
</script>
$data['content'] = $xcrud->render();
return view('demos', $data);
}
Employees
| # | Lastname | Firstname | Extension | Officecode | Reportsto | Jobtitle | City | Phone | Addressline1 | Addressline2 | State | Country | Postalcode | Territory | Ordering | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | DARA2 | DATRATRE | TANTA | dara@gmail.com | 4 | 454 | GIGIONE | Paris | +33 14 723 4404 | 43 Rue Jouffroy D'abbans | France | 75017 | EMEA | 4 | |||
| 2 | er | ytu | 1 | San Francisco | +1 650 219 4782 | 100 Market Street | Suite 300 | CA | USA | 94080 | NA | 0 |