mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Update docs for GridField_ActionMenuItem required parameters
I found these errors while going through this tutorial, missing ```use use SilverStripe\Forms\GridField\GridField;``` interface GridField_ActionMenuItem required parameters on getTitle() and getGroup() incorrect if statement on getExtraData() - $field is not defined
This commit is contained in:
parent
2bdf1eac0a
commit
168a4fe489
@ -22,6 +22,7 @@ below:
|
||||
use SilverStripe\Forms\GridField\GridField_ColumnProvider;
|
||||
use SilverStripe\Forms\GridField\GridField_ActionProvider;
|
||||
use SilverStripe\Forms\GridField\GridField_FormAction;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
use SilverStripe\Control\Controller;
|
||||
|
||||
class GridFieldCustomAction implements GridField_ColumnProvider, GridField_ActionProvider
|
||||
@ -176,20 +177,20 @@ class GridFieldDeleteAction implements GridField_ColumnProvider, GridField_Actio
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitle($gridField, $record)
|
||||
public function getTitle($gridField, $record, $columnName)
|
||||
{
|
||||
return _t(__CLASS__ . '.Delete', "Delete");
|
||||
}
|
||||
|
||||
public function getGroup($gridField, $record)
|
||||
public function getGroup($gridField, $record, $columnName)
|
||||
{
|
||||
return GridField_ActionMenuItem::DEFAULT_GROUP;
|
||||
}
|
||||
|
||||
public function getExtraData($gridField, $record, $columnName)
|
||||
{
|
||||
if ($field) {
|
||||
return $field->getAttributes();
|
||||
if ($gridField) {
|
||||
return $gridField->getAttributes();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user