RecordFinder can specify number of records per page

Fixes #2082
Fix spacing on composer.json
This commit is contained in:
Samuel Georges 2016-06-11 13:36:54 +10:00
parent e2f30cb8a4
commit 536a4b382c
2 changed files with 8 additions and 2 deletions

View File

@ -62,6 +62,6 @@
"recurse": true,
"replace": false,
"merge-dev": false
}
}
}
}

View File

@ -53,6 +53,11 @@ class RecordFinder extends FormWidgetBase
*/
public $prompt = 'Click the %s button to find a record';
/**
* @var int Maximum rows to display for each page.
*/
public $recordsPerPage = 10;
/**
* @var string Use a custom scope method for the list query.
*/
@ -115,6 +120,7 @@ class RecordFinder extends FormWidgetBase
'conditions',
'searchMode',
'searchScope',
'recordsPerPage',
]);
if (post('recordfinder_flag')) {
@ -241,7 +247,7 @@ class RecordFinder extends FormWidgetBase
$config->alias = $this->alias . 'List';
$config->showSetup = false;
$config->showCheckboxes = false;
$config->recordsPerPage = 10;
$config->recordsPerPage = $this->recordsPerPage;
$config->recordOnClick = sprintf("$('#%s').recordFinder('updateRecord', this, ':" . $this->keyFrom . "')", $this->getId());
$widget = $this->makeWidget('Backend\Widgets\Lists', $config);