or_where seems to break edit refresh and create strange behavior
or_where seems to break edit refresh and create strange behavior
Just posting this in case others have a similar issue.
Normally a datatable when edited has a default refresh behavior (the row turns yellow briefly then reflects the change), but when using an "or_where" clause, my table did not refresh.
Also, when adding new records, it seemed to insert a duplicate of the first row, instead of the data entered.
To fix this, Allan suggested I replace this:
->where( function ($q) {
$q->where('campus','MC')
->or_where('campus', 'both');
} )
with this:
->where( function ($q) {
$q->where_group( function ( $q2 ) {
$q2
->where('campus','MC')
->or_where('campus', 'both');
} );
} )
This fixed the issue for me! Hope it helps someone else!
-Brenda
This question has an accepted answers - jump to answer
Answers
This issue is resolved.
Thanks bpitoni, that did indeed solve a related issue for me.
bpitoni, this was indeed the fix I needed as well!
Allan, any chance this can make it into the documentation?
Sounds like a sensible idea to me - I'll add in information about it.
Thanks,
Allan