Skip to content

Commit

Permalink
Update Table.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ichynul authored Jun 5, 2020
1 parent 6326242 commit 731cde6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Closure;
use Encore\Admin\Form;
use Encore\Admin\Widgets\Form as WidgetForm;
use Encore\Admin\Form\Field;
use Ichynul\RowTable\Field\Collect;
use Ichynul\RowTable\Field\CollectValidator;
Expand Down Expand Up @@ -143,6 +144,27 @@ public function setForm(Form $form = null)

return $this;
}

/**
* Set Widget/Form as field parent.
*
* @param WidgetForm $form
*
* @return $this
*/
public function setWidgetForm(WidgetForm $form)
{
parent::setWidgetForm($form);

foreach ($this->rows as $row) {

foreach ($row->geFields() as $field) {
$field->setWidgetForm($form);
}
}

return $this;
}

/**
* Set table rows.
Expand Down

0 comments on commit 731cde6

Please sign in to comment.