List widget now supports injecting cssClasses
This commit is contained in:
parent
2f63a6ca0b
commit
5ce21e2fae
|
|
@ -130,6 +130,11 @@ class Lists extends WidgetBase
|
|||
*/
|
||||
public $treeExpanded = true;
|
||||
|
||||
/**
|
||||
* @var array List of CSS classes to apply to the list container element
|
||||
*/
|
||||
public $cssClasses = [];
|
||||
|
||||
/**
|
||||
* Initialize the widget, called by the constructor and free from its parameters.
|
||||
*/
|
||||
|
|
@ -176,6 +181,7 @@ class Lists extends WidgetBase
|
|||
*/
|
||||
public function prepareVars()
|
||||
{
|
||||
$this->vars['cssClasses'] = implode(' ', $this->cssClasses);
|
||||
$this->vars['columns'] = $this->getVisibleListColumns();
|
||||
$this->vars['columnTotal'] = $this->getTotalColumns();
|
||||
$this->vars['records'] = $this->getRecords();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
<div class="list-widget" id="<?= $this->getId() ?>">
|
||||
<div class="list-widget <?= $cssClasses ?>" id="<?= $this->getId() ?>">
|
||||
<?= $this->makePartial('list') ?>
|
||||
</div>
|
||||
Loading…
Reference in New Issue