awsqed
awsqed
FFilament
Created by awsqed on 10/27/2023 in #❓┊help
Single/double quote is encoded when using extraAttributes
I'm following the doc: https://filamentphp.com/docs/3.x/widgets/stats-overview#adding-extra-html-attributes-to-a-stat But it results in quote is being encode instead of what I expect. Code
return $action->extraAttributes([
'x-on:click.stop' => "\$dispatch('next-wizard-step', {statePath: 'data'})"
], true);
return $action->extraAttributes([
'x-on:click.stop' => "\$dispatch('next-wizard-step', {statePath: 'data'})"
], true);
Expectation
x-on:click.stop="$dispatch('next-wizard-step', {statePath: 'data'})"
x-on:click.stop="$dispatch('next-wizard-step', {statePath: 'data'})"
Actual
x-on:click.stop="$dispatch('next-wizard-step', {statePath: 'data'})"
x-on:click.stop="$dispatch('next-wizard-step', {statePath: 'data'})"
6 replies
FFilament
Created by awsqed on 10/20/2023 in #❓┊help
table select filter get all records instead of limiting it to relationship
I have a Customer model, which has many Album models, then the Album model belongs to a Stylist model. I make an table widget to display all the albums of that customer, and I create a select filter to filter albums based on the stylist name. Here is the table query:
protected function getTableQuery(): Builder
{
return $this->record->albums()->getQuery();
}
protected function getTableQuery(): Builder
{
return $this->record->albums()->getQuery();
}
Here is the filter:
protected function getTableFilters(): array
{
return [
SelectFilter::make('stylist')
->relationship('stylist', 'name')
->preload()
->searchable()
->native(false),
]
protected function getTableFilters(): array
{
return [
SelectFilter::make('stylist')
->relationship('stylist', 'name')
->preload()
->searchable()
->native(false),
]
Them problem is, instead of only get stylists relating to albums of that customer, it returns all stylists. I check debugbar and this is the query the filfer is using:
select * from `users` where `users`.`deleted_at` is null
select * from `users` where `users`.`deleted_at` is null
2 replies
FFilament
Created by awsqed on 10/17/2023 in #❓┊help
Clear table filter search input after dropdown is closed
I could set the search input value to empty but I'm having a struggle reset the dropdown result back to its original data
2 replies
FFilament
Created by awsqed on 10/10/2023 in #❓┊help
Register new chart type
How to register new chart type from the community? I installed the new chart type package and tried to register it like this but still got the error.
import './bootstrap';
import Chart from 'chart.js/auto';
import {TreemapController, TreemapElement} from 'chartjs-chart-treemap';

Chart.register(TreemapController, TreemapElement);
import './bootstrap';
import Chart from 'chart.js/auto';
import {TreemapController, TreemapElement} from 'chartjs-chart-treemap';

Chart.register(TreemapController, TreemapElement);
Uncaught Error: "treemap" is not a registered controller.
Uncaught Error: "treemap" is not a registered controller.
I think because I register to the wrong one, not the chart object Filament is using to render chart, but I don't know how to get the right one.
8 replies