diff --git a/src/Common/BaseItemList.php b/src/Common/BaseItemList.php index ce0946c8..ba913484 100644 --- a/src/Common/BaseItemList.php +++ b/src/Common/BaseItemList.php @@ -15,6 +15,9 @@ abstract class BaseItemList extends BaseHtmlElement { use BaseFilter; + /** @var string Emitted while assembling the list after adding each list item */ + public const ON_ITEM_ADD = 'item-added'; + /** @var array */ protected $baseAttributes = [ 'class' => ['item-list', 'default-layout'], @@ -63,6 +66,8 @@ protected function assemble(): void /** @var BaseListItem|BaseTableRowItem $item */ $item = new $itemClass($data, $this); $this->addHtml($item); + + $this->emit(self::ON_ITEM_ADD, [$item, $data]); } if ($this->isEmpty()) {