Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在AngularJS中展开剑道面板_Javascript_Angularjs_Kendo Ui_Expand - Fatal编程技术网

Javascript 在AngularJS中展开剑道面板

Javascript 在AngularJS中展开剑道面板,javascript,angularjs,kendo-ui,expand,Javascript,Angularjs,Kendo Ui,Expand,我正试图让我的剑道UI PanelBar网格的第一个面板在最初基于数据库中的参数加载页面时展开。因此,不要在li标记上使用class=“k-state-active”,而是从我的AngularJS控制器以编程方式扩展panelbar中的面板 以下是我的面板html: <ul kendo-panel-bar k-options="panelBarOptions" ng-controller="CreateItemCtrl" id="commentsPanelBar"> &l

我正试图让我的剑道UI PanelBar网格的第一个面板在最初基于数据库中的参数加载页面时展开。因此,不要在li标记上使用class=“k-state-active”,而是从我的AngularJS控制器以编程方式扩展panelbar中的面板

以下是我的面板html:

  <ul kendo-panel-bar k-options="panelBarOptions" ng-controller="CreateItemCtrl" id="commentsPanelBar">
    <li style="margin-top:0;margin-bottom:0;">
      COMMENTS
      <ul>
        <li style="height:140px;" id="pbComments">
           <input type='text' id='tbComments'></input>
        </li>

      </ul>
    </li>
  </ul>

运行这段代码后,我得到一个错误,“expand”不是一个函数。我知道此页面中引用了剑道脚本,因为面板栏会展开和折叠。

我看到您试图通过“commentsPanelBar”名称引用组件。我认为这是不正确的-据我所知,您应该在范围中定义您想要的名称:

<ul kendo-panel-bar="kendoBar" ...>
您可以在此处阅读定义小部件引用的可能方法:

我这样引用它是因为我的标签类似于
    。我试过这种方法,但也不管用。不过谢谢你的回复。
    <ul kendo-panel-bar="kendoBar" ...>
    
    $scope.kendoBar.expand()