Fix hardcoded column name `id` by reading the `keyFrom` option defined in the .yaml file.

This commit is contained in:
Jeferson Oliveira 2016-02-10 08:45:21 -02:00
parent af4f42e208
commit 6ae4742ff4
1 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ use Backend\Classes\FormWidgetBase;
* prompt: Click the Find button to find a user
* nameFrom: name
* descriptionFrom: email
*
*
* @package october\backend
* @author Alexey Bobkov, Samuel Georges
*/
@ -232,7 +232,7 @@ class RecordFinder extends FormWidgetBase
$config->showSetup = false;
$config->showCheckboxes = false;
$config->recordsPerPage = 20;
$config->recordOnClick = sprintf("$('#%s').recordFinder('updateRecord', this, ':id')", $this->getId());
$config->recordOnClick = sprintf("$('#%s').recordFinder('updateRecord', this, ':" . $this->keyFrom . "')", $this->getId());
$widget = $this->makeWidget('Backend\Widgets\Lists', $config);
// $widget->bindEvent('list.extendQueryBefore', function($query) {