1

I am trying to follow the October backend user interface style guide at: https://octobercms.com/docs/ui/list - specifically the Status column section.

I need to highlight row cells in green or red. The guide mention the CSS classes .negative and .positive and also the text-danger and text-success, however I can't get them to work.

I am adding the CSS classes in my columns.yaml file:

    status:
    label: Status
    type: text
    cssClass: 'oc-icon-circle text-danger negative'

Here is the generated HTML code when inspected on Chrome browser:

<td data-title="Status" class="list-cell-index-4 list-cell-name-status list-cell-type-text oc-icon-circle text-danger negative">
  Blocked
</td>

What is wrong of my code above? Is there any other classes I can use with OctoberCMS to highlight texts in a table row?

1 Answer 1

0

Maybe this can help you:

In the OctoberCMS doc we can find some css classes for highlight rows. And we can see an example in the Rainlab.User plugin.

From the controller, only need to add the method listInjectRowClass.

// This code is part of the \RainLab\User\Controllers\Users
public function listInjectRowClass($record, $definition = null)
{
    if ($record->trashed()) {
        return 'strike';
    }

    if (!$record->is_activated) {
        return 'disabled';
    }
}

Source: https://octobercms.com/forum/post/adding-row-class-to-lists-from-behavior

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.