本文整理汇总了PHP中GridField::ID方法的典型用法代码示例。如果您正苦于以下问题:PHP GridField::ID方法的具体用法?PHP GridField::ID怎么用?PHP GridField::ID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridField
的用法示例。
在下文中一共展示了GridField::ID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHTMLFragments
/**
* Returns a map where the keys are fragment names and the values are pieces of HTML to add to these fragments.
* @param GridField $gridField Grid Field Reference
* @return Array Map where the keys are fragment names and the values are pieces of HTML to add to these fragments.
*/
public function getHTMLFragments($gridField)
{
Requirements::css('gridfieldajaxrefresh/css/GridFieldAjaxRefresh.css');
Requirements::javascript('gridfieldajaxrefresh/javascript/GridFieldAjaxRefresh.js');
$data = array('RefreshDelay' => $this->refreshDelay, 'AutoRefresh' => $this->autoRefresh, 'GridFieldID' => $gridField->ID());
$forTemplate = new ArrayData($data);
$args = array('ID' => $gridField->ID());
return array($this->targetFragment => $forTemplate->renderWith('GridFieldAjaxRefresh_Header', $args));
}
示例2: getColumnContent
/**
* HTML for the column, content of the <td> element.
*
* @param \GridField $gridField
* @param \DataObject $record - Record displayed in this row
* @param string $columnName
*
* @return string - HTML for the column. Return NULL to skip.
*/
public function getColumnContent($gridField, $record, $columnName)
{
$classes = 'ss-gridfield-editable-row--icon';
if ($record) {
$classes .= ' ss-gridfield-editable-row--toggle';
}
$openToggleId = 'EditableRowToggles.' . $gridField->ID() . '.' . get_class($record) . '_' . $record->ID;
if ($this->openNewTogglesOnCreate && Session::get($openToggleId)) {
$classes .= ' ss-gridfield-editable-row--toggle_start';
}
Session::clear($openToggleId);
return sprintf('<i class="%s"></i>', $classes);
}