xddesigners/grid-field-styling

为您的 Silverstripe GridField 添加一些样式

安装次数: 59

依赖关系: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 1

开放问题: 0

类型:silverstripe-vendormodule

0.1.0 2023-03-15 14:09 UTC

This package is auto-updated.

Last update: 2024-08-31 00:38:47 UTC


README

为您的 Silverstripe GridField 添加一些样式。

安装

通过 composer 安装此模块

composer require xddesigners/grid-field-styling

示例

// Configure the gridfield filter form to always show
$gridField->visibleFilterForm();

// Set the gridfield to a dense format
$gridField->denseGrid();

// Removes the GridField_ActionMenu and the class 'grid-field__icon-action--hidden-on-hover'
$gridField->unhideActions();

// Add color to a single column in the row
$gridField->coloredColumn('NameOfColomnToColor');

// Add color to a row by the value of a colomn
$gridField->coloredRows('NameOfColomnThatDeterminesRowColor');

// These methods can also be chained together
$gridField
  ->visibleFilterForm()
  ->denseGrid();

您可以在 LeftAndMain 上定义自己的颜色,使用 yml 格式。这些颜色以 ColumnName 和 ColumnValue 命名。

SilverStripe\Admin\LeftAndMain:
  grid_field_colors:
    colomn-value: '#ff6600'