Skip to content

Commit 4eab9db

Browse files
author
Igor Chepurnoy
committed
Merge pull request #1 from AidasK/patch-1
feat: allow to overwrite default options
2 parents 64790a2 + 188334e commit 4eab9db

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

EditableColumn.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,13 @@ public function init()
6666
*/
6767
protected function renderDataCellContent($model, $key, $index)
6868
{
69-
7069
$value = parent::renderDataCellContent($model, $key, $index);
70+
$url = (array)$this->url;
71+
$this->options['data-url'] = Url::to($url);
72+
$this->options['data-pk'] = $key;
73+
$this->options['data-name'] = $this->attribute;
74+
$this->options['data-type'] = $this->type;
75+
7176
if (is_callable($this->editableOptions)) {
7277
$opts = call_user_func($this->editableOptions, $model, $key, $index);
7378
foreach ($opts as $prop => $v) {
@@ -79,12 +84,6 @@ protected function renderDataCellContent($model, $key, $index)
7984
}
8085
}
8186

82-
$url = (array)$this->url;
83-
$this->options['data-url'] = Url::to($url);
84-
$this->options['data-pk'] = $key;
85-
$this->options['data-name'] = $this->attribute;
86-
$this->options['data-type'] = $this->type;
87-
8887
return Html::a($value, null, $this->options);
8988
}
9089

0 commit comments

Comments
 (0)