我想将多个网格字段添加到一个页面类型。目前我正在这样做
$gridFieldConfig = GridFieldConfig::create()->addComponents(
new GridFieldToolbarHeader(),
new GridFieldAddNewButton('toolbar-header-right'),
new GridFieldSortableHeader(),
new GridFieldDataColumns(),
new GridFieldPaginator(10),
new GridFieldEditButton(),
new GridFieldDeleteAction(),
new GridFieldDetailForm()
);
$sliderField = new GridField('Slides', 'Slider', $this->Slides(), $gridFieldConfig);
$fields->addFieldToTab('Root.Slider', $sliderField);
$categoryField = new GridField('ShopCategories', 'Kategorien', $this->ShopCategories(), $gridFieldConfig);
$fields->addFieldToTab('Root.Shop Kategorien', $categoryField);
它有效,但问题是我得到了相同的“添加 blablabla 对象”标题。
如何在不使用多个 gridFieldConfigs 的情况下解决此问题?
提前谢谢