Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.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
Dynamic 角度UI(引导)-动态下拉列表在数据表中不起作用_Dynamic_Drop Down Menu_Datatables_Angular Ui_Angular Ui Bootstrap - Fatal编程技术网

Dynamic 角度UI(引导)-动态下拉列表在数据表中不起作用

Dynamic 角度UI(引导)-动态下拉列表在数据表中不起作用,dynamic,drop-down-menu,datatables,angular-ui,angular-ui-bootstrap,Dynamic,Drop Down Menu,Datatables,Angular Ui,Angular Ui Bootstrap,我想在数据表的单元格中使用Angular UI(引导)下拉按钮。使用页面上的下拉按钮没有问题,但是对于DataTables,它应该通过Javascript传递 感谢您的建议有人在Github中为此“问题”打开了一个问题。可能是作者本人: Wesley Cho用一记有力的重击回答说: 关键的一点是DataTables中的HTML没有被编译。因此,您必须在$rowCallback中使用$compile: rowCallback: function(row, data) { $(row)

我想在数据表的单元格中使用Angular UI(引导)下拉按钮。使用页面上的下拉按钮没有问题,但是对于DataTables,它应该通过Javascript传递


感谢您的建议

有人在Github中为此“问题”打开了一个问题。可能是作者本人:

Wesley Cho用一记有力的重击回答说:

关键的一点是DataTables中的HTML没有被编译。因此,您必须在$rowCallback中使用$compile:

rowCallback: function(row, data) {
    $(row).find('.button-wrapper').append(
      $compile('<div class="btn-group" dropdown><button id="split-button" type="button" class="btn btn-danger">Action</button><button type="button" class="btn btn-danger" dropdown-toggle><span class="caret"></span></button><ul class="dropdown-menu" role="menu" aria-labelledby="split-button"><li role="menuitem"><a href="#">Action</a></li></ul></div>')($scope)
    );
  }
rowCallback:函数(行,数据){
$(行).find('.button wrapper').append(
$compile($scope)
);
}

很高兴能帮助您。如果答案有帮助,你应该投票。因此,不鼓励说谢谢等的评论。如果答案回答了你的问题,你应该接受它。见: