mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Added ModelAdmin:: for changing the class used to generate results tables
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@67165 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1c98c2e8e5
commit
6d45e58587
@ -96,6 +96,19 @@ abstract class ModelAdmin extends LeftAndMain {
|
||||
*/
|
||||
protected static $page_length = 30;
|
||||
|
||||
/**
|
||||
* Class name of the form field used for the results list. Overloading this in subclasses
|
||||
* can let you customise the results table field.
|
||||
*/
|
||||
protected $resultsTableClassName = 'TableListField';
|
||||
|
||||
/**
|
||||
* Return {@link $this->resultsTableClassName}
|
||||
*/
|
||||
public function resultsTableClassName() {
|
||||
return $this->resultsTableClassName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the model admin interface. Sets up embedded jquery libraries and requisite plugins.
|
||||
*
|
||||
@ -582,7 +595,8 @@ class ModelAdmin_CollectionController extends Controller {
|
||||
if($searchCriteria instanceof HTTPRequest) $searchCriteria = $searchCriteria->getVars();
|
||||
$summaryFields = $this->getResultColumns($searchCriteria);
|
||||
|
||||
$tf = new TableListField(
|
||||
$className = $this->parentController->resultsTableClassName();
|
||||
$tf = new $className(
|
||||
$this->modelClass,
|
||||
$this->modelClass,
|
||||
$summaryFields
|
||||
|
Loading…
Reference in New Issue
Block a user