Are there any way to limit the setRelation to existing data only? I’ve noticed that when we use setRelation all the data from the related table is retrieved (and showed in the search combo filter, even if it is not present in the datagrid).
post by bgeneto on Nov 26, 2024
11 days later
post by johnny on Dec 8, 2024
Hello @bgeneto ,
Yes this is possible with the where parameter of setRelation. For example something like this (don’t forget the parenthesis):
$crud->setRelation('country', 'countries', 'nicename', '(c.iso IS NOT NULL)');
New & Unread Topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Use callbackColumn() but keep inline edit functionality |
|
3 | 633 | Apr 12 |
| Setting quick search values via JavaScript not working properly for booleans |
|
0 | 558 | Nov 2025 |
| callbackColumn() has not effect in v3.2.6 Enterprise |
|
2 | 683 | Dec 2025 |
| displayAs() doesn’t support new line in headings |
|
4 | 855 | Jan 5 |
| “Ooooops, something went wrong! If you can see this message, this is probably a misconfiguration in Grocery CRUD Enterprise!” |
|
6 | 234 | 4d |