Changing row color based on the data #15481
Unanswered
RezaRafli42
asked this question in
Help
Replies: 1 comment 2 replies
-
Is it a Resource or Custom Page? Are you sure that your content configuration in tailwind.config.js is scanning for this directory/class? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Package
Table builder
Package Version
v.3.2
How can we help you?
hello, i have a problem when changing row color in my admin panel, i have following the documentation about recordClasses and add directory in tailwind.config.js but it still didnt work. style only work when i use "border-2" and "bg-gray-100", other style totally not working. can someone help me?
tahankyou!
this is my table code :
return $table
->query(
OfficeWarehouse::query()
->withSum('officeWarehouseStocks', 'quantity')
)
->recordClasses(fn(Model $record) => match ($record->item->name) {
'Engine' => 'bg-red-500 border-2',
default => null,
})
->columns([
Tables\Columns\TextColumn::make('item.name')
->label('Item Name')
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('office_warehouse_stocks_sum_quantity')
->label('Total Quantity')
->sortable(),
Tables\Columns\TextColumn::make('minimum_quantity')
->label('Minimum Quantity')
->sortable(),
])
Beta Was this translation helpful? Give feedback.
All reactions