蟹道人 2015-03-16 02:22 采纳率: 0%
浏览 4282
已结题

angularJs-datatables 如何实现同时刷新多个表

//上面的这个方法报错
DTInstances.getList().then(function (result) {
dtInstance = result;
});

Error: _dtInstances is null
getList@http://localhost:8080/bower_components/angular-datatables/dist/angular-datatables.js:457:9
@http://localhost:8080/scripts/app/adminCustomer/licenseManage/allotProduct/allotProduct.controller.js:203:9
invoke@http://localhost:8080/bower_components/angular/angular.js:3965:14
instantiate@http://localhost:8080/bower_components/angular/angular.js:3976:23
$ControllerProvider/this.$get</<@http://localhost:8080/bower_components/angular/angular.js:7315:18
$ViewDirectiveFill/<.compile/<@http://localhost:8080/bower_components/angular-ui-router/release/angular-ui-router.js:3897:28
nodeLinkFn@http://localhost:8080/bower_components/angular/angular.js:6752:13
compositeLinkFn@http://localhost:8080/bower_components/angular/angular.js:6146:13
publicLinkFn@http://localhost:8080/bower_components/angular/angular.js:6042:30
updateView@http://localhost:8080/bower_components/angular-ui-router/release/angular-ui-router.js:3839:23
$ViewDirective/directive.compile/</<@http://localhost:8080/bower_components/angular-ui-router/release/angular-ui-router.js:3801:11
$RootScopeProvider/this.$get</Scope.prototype.$broadcast@http://localhost:8080/bower_components/angular/angular.js:13093:15
transitionTo/$state.transition<@http://localhost:8080/bower_components/angular-ui-router/release/angular-ui-router.js:3218:11
qFactory/defer/deferred.promise.then/wrappedCallback@http://localhost:8080/bower_components/angular/angular.js:11682:31
qFactory/ref/<.then/<@http://localhost:8080/bower_components/angular/angular.js:11768:26
$RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:8080/bower_components/angular/angular.js:12811:16
$RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:8080/bower_components/angular/angular.js:12623:15
$RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:8080/bower_components/angular/angular.js:12915:13
done@http://localhost:8080/bower_components/angular/angular.js:8450:34
completeRequest@http://localhost:8080/bower_components/angular/angular.js:8664:7
createHttpBackend/</xhr.onreadystatechange@http://localhost:8080/bower_components/angular/angular.js:8603:1

使用getLast()
DTInstances.getLast().then(function (result) {
dtInstance = result;
})
只能刷新一个表

  • 写回答

2条回答 默认 最新

  • Csuccess 2015-03-16 03:13
    关注

    用watch监听 $scope.$watch('pagingOptions', function (newVal, oldVal) {
    if (newVal !== oldVal) {
    在这里执行刷新
    }, true);

    评论

报告相同问题?

悬赏问题

  • ¥15 矩阵加法的规则是两个矩阵中对应位置的数的绝对值进行加和
  • ¥15 活动选择题。最多可以参加几个项目?
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
  • ¥20 怎么在stm32门禁成品上增加查询记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B
  • ¥15 想问一下stata17中这段代码哪里有问题呀