xddesigners / grid-field-styling
为您的 Silverstripe GridField 添加一些样式
0.1.0
2023-03-15 14:09 UTC
Requires
- silverstripe/cms: >=4.0
- silverstripe/framework: >=4.0
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'