本文整理匯總了PHP中GridFieldConfig_RecordEditor::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP GridFieldConfig_RecordEditor::__construct方法的具體用法?PHP GridFieldConfig_RecordEditor::__construct怎麽用?PHP GridFieldConfig_RecordEditor::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GridFieldConfig_RecordEditor
的用法示例。
在下文中一共展示了GridFieldConfig_RecordEditor::__construct方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct($itemsPerPage = null, $sort = true)
{
parent::__construct($itemsPerPage);
if ($sort) {
if (class_exists('GridFieldSortableRows')) {
$this->addComponent(new GridFieldSortableRows('SortOrder'));
} elseif (class_exists('GridFieldOrderableRows')) {
$this->addComponent(new GridFieldOrderableRows('SortOrder'));
}
}
if (class_exists('GridFieldBulkManager')) {
$this->addComponent(new GridFieldBulkManager());
}
}
示例2: __construct
/**
* @param int $itemsPerPage
* @param array|SS_List $mergeRecords
* @param string $parentType
* @param string $parentMethod
* @param string $childMethod
*/
public function __construct($itemsPerPage = 15, $mergeRecords, $parentType, $parentMethod, $childMethod)
{
parent::__construct($itemsPerPage);
$this->removeComponentsByType('GridFieldAddNewButton');
$this->addComponent(new GridFieldAddByDBField('buttons-before-left'));
$this->addComponent(new GridFieldMergeAction($mergeRecords, $parentType, $parentMethod, $childMethod));
/**
* @var GridFieldDataColumns $columns
*/
$columns = $this->getComponentByType('GridFieldDataColumns');
$columns->setFieldFormatting(array('BlogPostsCount' => function ($value, CategorisationObject $item) {
return $item->BlogPosts()->Count();
}));
$this->changeColumnOrder();
}
示例3: __construct
public function __construct($itemsPerPage = 25)
{
parent::__construct($itemsPerPage);
// $this->addComponent(new GridFieldExportButton());
$this->addComponent(new CommentsGridFieldAction());
// Format column
$columns = $this->getComponentByType('GridFieldDataColumns');
$columns->setFieldFormatting(array('ParentTitle' => function ($value, &$item) {
return sprintf('<a href="%s" class="cms-panel-link external-link action" target="_blank">%s</a>', Convert::raw2att($item->Link()), $item->obj('ParentTitle')->forTemplate());
}));
// Add bulk option
$manager = new GridFieldBulkManager();
$manager->addBulkAction('spam', 'Spam', 'CommentsGridFieldBulkAction_Handlers', array('isAjax' => true, 'icon' => 'cross', 'isDestructive' => false));
$manager->addBulkAction('approve', 'Approve', 'CommentsGridFieldBulkAction_Handlers', array('isAjax' => true, 'icon' => 'cross', 'isDestructive' => false));
$manager->removeBulkAction('bulkEdit');
$manager->removeBulkAction('unLink');
$this->addComponent($manager);
}
示例4: __construct
/**
* @param {int} $itemsPerPage How many items per page should show up
*/
public function __construct($itemsPerPage = null)
{
parent::__construct($itemsPerPage);
$this->removeComponentsByType('GridFieldDetailForm')->addComponent(new FrontEndGridFieldDetailForm());
}
開發者ID:helpfulrobot,項目名稱:webbuilders-group-silverstripe-frontendgridfield,代碼行數:8,代碼來源:FrontEndGridFieldConfig.php
示例5: __construct
public function __construct($itemsPerPage = null, $numberToLimitTo = null)
{
parent::__construct($itemsPerPage);
$this->removeComponentsByType('GridFieldDetailForm');
$this->addComponent(new LRGridFieldDetailForm('DetailForm', $numberToLimitTo));
}
開發者ID:helpfulrobot,項目名稱:webbuilders-group-silverstripe-limitedrelationsgridfield,代碼行數:6,代碼來源:LRGridFieldConfig.php
示例6: GridFieldUserColumns
function __construct($itemsPerPage = null)
{
parent::__construct($itemsPerPage);
$this->addComponent(new GridFieldUserColumns());
}