【发布时间】:2013-03-02 13:24:48
【问题描述】:
我正在使用 yii ctreeview 扩展,我无法通过节点单击来展开/折叠节点 - 只能使用 +/-。有人知道出了什么问题吗?
<div id="treeview">
<?php $this->widget('ext.CTreeView_M',
array(
'data'=>$data,
'animated'=>'fast',
'collapsed'=>false,
'htmlOptions'=>array('class'=>'treeview-famfamfam'),
));
?>
</div>
【问题讨论】:
-
你能显示使用
$data的内容吗(例如通过 var_dump)? -
以防万一:树视图运行良好,但我只想通过单击例如显示孩子在“根”上 - 数据数组:
array(1) { [0]=> array(4) { ["text"]=> string(4) "root" ["id"]=> int(0) ["hasChildren"]=> bool(true) ["children"]=> array(24) { [82]=> array(4) { ["text"]=> string(7) "help me" ["id"]=> int(82) ["hasChildren"]=> bool(true) ["children"]=> array(1) { [83]=> array(4) { ["text"]=> string(4) "now!" ["id"]=> int(83) ["hasChildren"]=> bool(true) ["children"]=> array(1) { [93]=> array(3) { ["text"]=> string(3) "tst" ["id"]=> int(93) ["hasChildren"]=> bool(false) } } } } } -
hum 对我来说似乎不错,您是否在多个网络浏览器中尝试过?
-
是的,但它不起作用......
-
什么是“ext.CTreeView_M”?它不是 yii 核心小部件...
标签: php yii treeview expand collapse