recordUrl should be taking priority over the default onClick behavior

This commit is contained in:
Samuel Georges 2015-03-31 09:57:44 +11:00
parent 0612e652ea
commit 264cb0119d
1 changed files with 5 additions and 1 deletions

View File

@ -550,6 +550,7 @@ class RelationController extends ControllerBehavior
$config->defaultSort = $this->getConfig('view[defaultSort]');
$config->recordsPerPage = $this->getConfig('view[recordsPerPage]');
$config->showCheckboxes = $this->getConfig('view[showCheckboxes]', !$this->readOnly);
$config->recordUrl = $this->getConfig('view[recordUrl]', null);
$defaultOnClick = sprintf(
"$.oc.relationBehavior.clickViewListRecord(':id', '%s', '%s')",
@ -557,8 +558,11 @@ class RelationController extends ControllerBehavior
$this->relationGetSessionKey()
);
if ($config->recordUrl) {
$defaultOnClick = null;
}
$config->recordOnClick = $this->getConfig('view[recordOnClick]', $defaultOnClick);
$config->recordUrl = $this->getConfig('view[recordUrl]', null);
if ($emptyMessage = $this->getConfig('emptyMessage')) {
$config->noRecordsMessage = $emptyMessage;