Class CTreeView
CTreeView displays a tree view of hierarchical data.
It encapsulates the excellent tree view plugin for jQuery (http://bassistance.de/jquery-plugins/jquery-plugin-treeview/).
To use CTreeView, simply sets CTreeView::$data
to the data that you want to
present and you are there.
CTreeView also supports dynamic data loading via AJAX. To do so, set CTreeView::$url
to be the URL that can serve the tree view data upon request.
- CComponent
- CBaseController
- CWidget
- CTreeView
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/web/widgets/CTreeView.php
public
|
|
public
|
|
protected
array
|
|
public static
string
|
|
public static
string
|
#
saveDataAsJson( array $data )
Saves tree view data in JSON format. This method is typically used in dynamic tree view loading when the server code needs to send to the client the dynamic tree view data. |
__construct(),
actions(),
getController(),
getId(),
getOwner(),
getViewFile(),
getViewPath(),
render(),
setId()
|
beginCache(),
beginClip(),
beginContent(),
beginWidget(),
createWidget(),
endCache(),
endClip(),
endContent(),
endWidget(),
renderFile(),
renderInternal(),
widget()
|
public
array
|
$data |
|
#
the data that can be used to generate the tree view content. Each array element
corresponds to a tree view node with the following structure:
|
public
mixed
|
$cssFile |
|
#
the CSS file used for the widget. Defaults to null, meaning using the default CSS file included together with the widget. If false, no CSS file will be used. Otherwise, the specified CSS file will be included when using this widget. |
public
string|array
|
$url |
|
#
the URL to which the treeview can be dynamically loaded (in AJAX). See |
public
string|integer
|
$animated |
|
#
animation speed. This can be one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). If not set, no animation is used. |
public
boolean
|
$collapsed |
|
#
whether the tree should start with all branches collapsed. Defaults to false. |
public
string
|
$control |
|
#
container for a tree-control, allowing the user to expand, collapse and toggle all branches with one click. In the container, clicking on the first hyperlink will collapse the tree; the second hyperlink will expand the tree; while the third hyperlink will toggle the tree. The property should be a valid jQuery selector (e.g. '#treecontrol' where 'treecontrol' is the ID of the 'div' element containing the hyperlinks.) |
public
boolean
|
$unique |
|
#
set to allow only one branch on one level to be open (closing siblings which opening). Defaults to false. |
public
string
|
$toggle |
|
#
Callback when toggling a branch. Arguments: "this" refers to the UL that was shown or hidden |
public
string
|
$persist |
|
#
Persist the tree state in cookies or the page location. If set to "location", looks for the anchor that matches location.href and activates that part of the treeview it. Great for href-based state-saving. If set to "cookie", saves the state of the tree on each click to a cookie and restores that state on page load. |
public
string
|
$cookieId |
|
#
The cookie name to use when persisting via persist:"cookie". Defaults to 'treeview'. |
public
boolean
|
$prerendered |
|
#
Set to skip rendering of classes and hitarea divs, assuming that is done by the serverside. Defaults to false. |
public
array
|
$options | array() |
#
additional options that can be passed to the constructor of the treeview js object. |
public
array
|
$htmlOptions |
|
#
additional HTML attributes that will be rendered in the UL tag. The default tree
view CSS has defined the following CSS classes which can be enabled by
specifying the 'class' option here:
|
$actionPrefix,
$skin
|
$controller,
$id,
$owner,
$viewPath
|