Replies: 3 comments
-
Unfortunately, I'm not sure what could be causing this behavior. For now, I'll move this to discussions |
Beta Was this translation helpful? Give feedback.
-
I am encountering the same problem where joined columns are not recognized when attempting to use ->searchable(). Unfortunately, I don't have a solution either, but I wanted to let you know that you're not the only one experiencing this.
|
Beta Was this translation helpful? Give feedback.
-
Hello I think I figured out what's causing the problem. if ($hasColumn) {
try {
ds([$columnList, $field]);
ds("{$table}.{$field}")->blue();
$query->orWhere("{$table}.{$field}", Sql::like($query), "%{$search}%");
} catch (\Throwable) {
$query->orWhere("{$table}.{$field}", Sql::like($query), "%{$search}%");
}
} Thanks |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Have you searched through other issues to see if your problem is already reported or has been fixed?
Yes, I did not find it.
Did you read the documentation?
Yes, I did not find it.
Have you tried to publish the views?
No, this error is not related to views.
Is there an error in the console?
No
PHP Version
8.3
PowerGrid
5.8.0
Laravel
11.10
Livewire
3.5.0
Alpine JS
No response
Theme
Tailwind 3.x
Describe the bug.
Hi, I am struggling to find why my implementation doesn't work.
For background II have 2 table that I have joined in the datasource (for the sake of testing I have added all the possible variations for my field):
In the fileds definition I have added all the variants:
As also in the columns method:
The sql is generated correctly and I can order all the fields
but when I try to use the global search, the joined field are ignored:
I can't understand what I am doing different from the join example in the docs (https://demo.livewire-powergrid.com/examples/datasource-join).
Digging in the package code the only place where I can see maybe(?) an error is inside src/DataSource/Builder.php
on line 141
Where the method return the original table's field list but not the joined ones, so the consequential on line 152 gave false and the column is skipped
But why in the join demo it works?
Hope someone can point me in the right direction, thanks!
To Reproduce...
No response
Extra information
No response
Beta Was this translation helpful? Give feedback.
All reactions