kartik-v / yii2-tree-manager

An advanced tree management module using nested sets for Yii 2.
http://demos.krajee.com/tree-manager
Other
150 stars 107 forks source link

Topmost root node display enhancements #178

Closed kartik-v closed 6 years ago

kartik-v commented 6 years ago

The following new properties will be added to TreeView widget:

    /**
     * @var boolean whether to hide the topmost root node container
     */
    public $hideTopRoot = false;

    /**
     * @var boolean whether to show topmost root node as heading. In this case the 
     * [[rootOptions]] will be used to format the topmost root node and 
     * [[headingOptions]] will be skipped.
     */
    public $topRootAsHeading = false;

Heading rendering will be modified based on above settings

    /**
     * @var array the HTML attributes for the heading. The following additional option is recognized:
     * `label`: _string_, the label to display for the heading
     * Note that when [[topRootAsHeading]] is set to true, then [[headingOptions]] will be entirely skipped
     * and [[rootOptions]] and [[rootNodeToggleOptions]] and [[rootNodeCheckboxOptions]] will be used to render 
     * the heading.
     */
    public $headingOptions = ['class' => 'kv-tree-heading'];