蟹道人 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);

    评论

报告相同问题?

悬赏问题

  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了