我在我的应用程序中使用了角度数据表。我应用了下面给出的选项,
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withOption('responsive', true)
.withOption('bAutoWidth', false)
.withOption('paging', false)
.withOption('sorting', false)
.withOption('searching', false)
.withOption('info', false)
.withDOM('frtip');
我将列定义设置如下,
$scope.dtColumnDefs = [
DTColumnDefBuilder.newColumnDef(0).notSortable(),
DTColumnDefBuilder.newColumnDef(1).notSortable(),
DTColumnDefBuilder.newColumnDef(2).notSortable(),
DTColumnDefBuilder.newColumnDef(3).notSortable(),
DTColumnDefBuilder.newColumnDef(4).notSortable(),
DTColumnDefBuilder.newColumnDef(5).notSortable(),
DTColumnDefBuilder.newColumnDef(6).notSortable(),
DTColumnDefBuilder.newColumnDef(7).notSortable()
];
我使用角度表作为 html 页面,
<table id="userTable" datatable="ng" dt-options="dtOptions" dt-column-defs="dtColumnDefs" class="table table-striped table-bordered dt-responsive nowrap res_table" cellspacing="0" width="100%">
我不需要数据表的分页。所以我删除了它。但是我需要在表中实现延迟加载。我通过在选项中添加以下内容在表格中添加了滚动条,
.withOption('scrollY', '48vh')
但我无法捕捉到表格的滚动事件。如何识别滚动到达表格末尾?所以我可以从服务器获取下一组数据并附加到表中。请帮我。