我想知道是否可以使用jqtree或yii的另一个扩展来在树视图中呈现视图。我试图用jqtree做到这一点而没有结果。这样的事情:
$dataTree = array(
array(
'label' => 'node1',
'children' => array(
array('label' => 'child2'.$this->renderPartial('_nps_level_form',array('rawdatalevel'=>$secondrawdatalevel,'idgeolevel'=>$value),true,false)),
array('label' => 'child2'),
),
),
array(
'label' => 'node2',
)
);
$this->widget('ext.yii-jqTree.JQTree', array(
'id' => 'treeview',
'data' => $dataTree,
'dragAndDrop' => true,
'selectable' => true,
'saveState' => true,
'autoOpen' => false,
'htmlOptions' => array(
'class' => 'treeview-red',
),
));
当我这样做时,我得到的是:
node1
child2 <div style="border: 1px solid #ddd; margin: 0 auto; width: 700px; height: 70px; padding-top: 10px; border-radius: 5px;"> <div style="margin-left: 25px; margin-bottom: 30px; float: left;"> <div style=" font-weight: 700; font-size: 0.9em; line-height: 1em; color: #454447;"> NPS: </div> <div style="font-family: 'Open Sans Condensed', Verdana, sans-serif; font-weight: 700; font-size: 40px; line-height: 1em; letter-spacing: -2px; text-indent: -8px; color: #C78D05; text-align: center;"> 0.0% </div> </div> <div style="width: 100px; margin-left: 40px; float: left;"> <a style="text-decoration: none; color: #454447;" href="/index.php?r=npsTicket/index&type=promotor"> <span style="font-weight: 700; font-size: 10px; font-family: 'Open Sans Condensed', Verdana, sans-serif; text-transform: uppercase;">Promotors</span><br> <span style="font-family: 'Open Sans Condensed', Verdana, sans-serif; font-weight: 700; font-size: 20px; line-height: 1em; letter-spacing: -2px; text-indent: -8px; color: #89A54E;"> 0% </span> <span> </span> </a> </div> <div style="width: 100px; float: left;"> <a style="text-decoration: none; color: #454447;" href="/index.php?r=npsTicket/index&type=detractor"> <span style="font-weight: 700; font-size: 10px; font-family: 'Open Sans Condensed', Verdana, sans-serif; text-transform: uppercase;">Detractors</span><br> <span style="font-family: 'Open Sans Condensed', Verdana, sans-serif; font-weight: 700; font-size: 20px; line-height: 1em; letter-spacing: -2px; text-indent: -8px; color: #AA4643;"> 0% </span> <span> </span> </a> </div> <div style="width: 100px; float: left;"> <span style="font-weight: 700; font-size: 10px; font-family: 'Open Sans Condensed', Verdana, sans-serif; text-transform: uppercase;">Passives</span><br> <span style="font-family: 'Open Sans Condensed', Verdana, sans-serif; font-weight: 700; font-size: 20px; line-height: 1em; letter-spacing: -2px; text-indent: -8px; color: #F2C452;"> 0%</span> <span> </span> </div> <div style="width: 86px; margin-left: 8px; margin-top: -8px; float: left;"> </div> <div style="text-align: center; margin-top: 5px; float: left; width: 120px; font-weight: 700; font-size: 10px; font-family: 'Open Sans Condensed', Verdana, sans-serif; text-transform: uppercase;"> Total Answered:<br> <span style="font-size: 1.9em; color: #439AA8;">0%</span> <span style="font-size: 1.9em; color: #454447;"> - </span> <span style="font-size: 1.9em; color: #439AA8;">0</span> </div> </div>
child2
node2