components/TreeBuilder.php
public function nodeAttributes($model = false, $pid = '', $uniqueKey = false)
    {
        $uniqueKey = $uniqueKey ? $uniqueKey : self::$uniqueKey++;
        $model     = ($model) ? $model : $this->owner;
        $id        = $model[$this->id];
        $nodeId    = $uniqueKey . '-id-' . $id;

        return array(
            'id'       => $nodeId,
            'model'    => $model,
            'children' => $model[$this->childrenAttribute],
            'text'     => $model['name'],
            'type'     => $model['type'] == 1 ? 'user' : 'flag',
            'selected' => in_array($model[$this->id], $this->selectedNodes),
            'a_attr'   => array(
                'class'   => 'jstree-clicked',
                'data-id' => $nodeId,
                'href'      => [$this->actionPath, $this->id => $id, 'pid'=> $pid]
            )
        );
    }
public function nodeAttributes($model = false, $pid = '', $uniqueKey = false)
    {
        $uniqueKey = $uniqueKey ? $uniqueKey : self::$uniqueKey++;
        $model     = ($model) ? $model : $this->owner;
        $id        = $model[$this->id];
        $nodeId    = $uniqueKey . '-id-' . $id;

        return array(
            'id'       => $nodeId,
            'model'    => $model,
            'children' => $model[$this->childrenAttribute],
            'text'     => $model['name'],
            'type'     => $model['type'] == 1 ? 'user' : 'flag',
            'selected' => in_array($model[$this->id], $this->selectedNodes),
            'a_attr'   => array(
                'class'   => 'jstree-clicked',
                'data-id' => $nodeId,
                'href'      => [$this->actionPath, $this->id => $id, 'pid'=> $pid]
            )
        );
    }
public function nodeAttributes ( $ model = false , $ pid = '' , $ uniqueKey = false ) { $ uniqueKey = $ uniqueKey ? $ uniqueKey : self :: $ uniqueKey ++ ; $ model = ( $ model ) ? $ model : $ this -> owner ; $ id = $ model [ $ this -> id ] ; $ nodeId = $ uniqueKey . '-id-' . $ id ; return array ( 'id' => $ nodeId , 'model' => $ model , 'children' => $ model [ $ this -> childrenAttribute ] , 'text' => $ model [ 'name' ] , 'type' => $ model [ 'type' ] == 1 ? 'user' : 'flag' , 'selected' => in_array ( $ model [ $ this -> id ] , $ this -> selectedNodes ) , 'a_attr' => array ( 'class' => 'jstree-clicked' , 'data-id' => $ nodeId , 'href' => [ $ this -> actionPath , $ this -> id => $ id , 'pid' => $ pid ] ) ) ; }
Generates attributes for jstree item from owner model.
@param mixed $model model
@param mixed $pid view item parent id.
@param bool $uniqueKey unique node view id prefix.
@return array attributes
Generates attributes for jstree item from owner model .