This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
fields.yaml
fields:
testcol:
type: repeater
form:
fields:
title:
label: ITEM
item:
type: repeater
prompt: Add new subitem
form:
fields:
subtitle:
span: left
label: subitem
I create item with two subitems:
When if I add a new item, I get the following picture:
But I expected get the following:
Is it normal behavior or bug?!
Last updated
But the data saved in database properly. I should only delete excess subitems manually. Bug occurs only when I create a new ITEM.
Last updated
I think I found the solution!))) Adding this code into root\modules\backend\formwidgets\Repeater.php will solve the problem
protected function processExistingItems()
{
$loadValue = $this->getLoadValue();
if (is_array($loadValue)) {
$loadValue = array_keys($loadValue);
}
$itemIndexes = post(self::INDEX_PREFIX.$this->formField->getName(false), $loadValue);
------> if (!$loadValue) return;
if (!is_array($itemIndexes)) return;
foreach ($itemIndexes as $itemIndex) {
$this->makeItemFormWidget($itemIndex);
$this->indexCount = max((int) $itemIndex, $this->indexCount);
}
}
Last updated
beaudinngreve10852 said:
it seems that Nested repeaters are now supported
hmmmm... They don't seem to work on Static Pages. Has anyone figured this out?
hmmmm... They don't seem to work on Static Pages. Has anyone figured this out?
I have the same problem... anybody with an idea how to solve this?
info17589 said:
hmmmm... They don't seem to work on Static Pages. Has anyone figured this out?
I have the same problem... anybody with an idea how to solve this?
1-9 of 9