public function getJsLayout()
{
$filterItems = $this->getFilter()->getItems();
$jsLayoutConfig = ['component' => self::JS_COMPONENT, 'maxSize' => (int) $this->getFilter()->getAttributeModel()->getFacetMaxSize(), 'hasMoreItems' => (bool) $this->getFilter()->hasMoreItems(), 'ajaxLoadUrl' => $this->getAjaxLoadUrl()];
foreach ($filterItems as $item) {
$jsLayoutConfig['items'][] = $item->toArray(['label', 'count', 'url', 'is_selected']);
}
return json_encode($jsLayoutConfig);
}