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

left join source

$
0
0

i have an editor instance with a left join

what i am doing is counting the number of times a certain id occurs in the joined table

on my datatable i have a delete button which is rendered on condition that the left joined source returns null, so that delete is only possible in the main table, if there are no dependent rows.

The only way i have been able to get this to work is to create a view returning a count of the id, and using the view in the join.

This works fine, but it means creating a view each time I want to do this.

eg

->leftJoin( 'vw_itemtypes_count', 'vw_itemtypes_count.ItemTypeID', '=', 'refitemtype.ItemTypeID' )

Is it possible to have my left join use a standard mysql expression so i could create the join without having to create the view each time ?


Viewing all articles
Browse latest Browse all 3740