Closed LucasZdv closed 3 years ago
@LukeTowers Thanks for everything.
I want to add this in the states, any idea how i can it? -
public function listInjectRowClass($record, $definition = null)
{
if (!$record->is_enabled) {
return 'safe disabled';
}
}
This adds a css class to the disabled countries, I want to do the same in the states to make it verbose.
@LucasZdv you'd have to extend the relation view widget and bind into the list.injectRowClass event. Something like
public function relatedExtendViewWidget($widget)
{
$widget->bindEvent('list.injectRowClass', function ($record) {
return !$record->is_enabled ? 'safe disabled';
});
}
@LucasZdv are you still wanting to add the styling to the states lists widget?
@LucasZdv are you still wanting to add the styling to the states lists widget?
Yes, but it hasn't worked for me. Where should I do the extension? I added this to the controller, but not sure where it goes.
In the Country controller. Do some debugging to see if the variables you're getting are what you expect.
Works now! https://github.com/rainlab/location-plugin/pull/82/commits/cde059db97e739bdb9a6e01b7655c9a77fffee10
public function relationExtendViewWidget($widget)
{
$widget->bindEvent('list.injectRowClass', function ($record) {
if(!$record->is_enabled) {
return 'safe disabled';
}
});
}
Hello, is it possible to go to master?
Hello, I am pleased to make this small contribution.