...
|
...
|
@@ -72,7 +72,7 @@ export default function AttributeTableDirective($compile, $templateCache, $rootS |
72
|
72
|
scope.$watch("deviceId", function(newVal, prevVal) {
|
73
|
73
|
if (newVal && !angular.equals(newVal, prevVal)) {
|
74
|
74
|
scope.resetFilter();
|
75
|
|
- scope.getDeviceAttributes();
|
|
75
|
+ scope.getDeviceAttributes(false, true);
|
76
|
76
|
}
|
77
|
77
|
});
|
78
|
78
|
|
...
|
...
|
@@ -81,7 +81,7 @@ export default function AttributeTableDirective($compile, $templateCache, $rootS |
81
|
81
|
scope.mode = 'default';
|
82
|
82
|
scope.query.search = null;
|
83
|
83
|
scope.selectedAttributes = [];
|
84
|
|
- scope.getDeviceAttributes();
|
|
84
|
+ scope.getDeviceAttributes(false, true);
|
85
|
85
|
}
|
86
|
86
|
});
|
87
|
87
|
|
...
|
...
|
@@ -117,15 +117,25 @@ export default function AttributeTableDirective($compile, $templateCache, $rootS |
117
|
117
|
}
|
118
|
118
|
}
|
119
|
119
|
|
120
|
|
- scope.getDeviceAttributes = function(forceUpdate) {
|
|
120
|
+ scope.onReorder = function() {
|
|
121
|
+ scope.getDeviceAttributes(false, false);
|
|
122
|
+ }
|
|
123
|
+
|
|
124
|
+ scope.onPaginate = function() {
|
|
125
|
+ scope.getDeviceAttributes(false, false);
|
|
126
|
+ }
|
|
127
|
+
|
|
128
|
+ scope.getDeviceAttributes = function(forceUpdate, reset) {
|
121
|
129
|
if (scope.attributesDeferred) {
|
122
|
130
|
scope.attributesDeferred.resolve();
|
123
|
131
|
}
|
124
|
132
|
if (scope.deviceId && scope.attributeScope) {
|
125
|
|
- scope.attributes = {
|
126
|
|
- count: 0,
|
127
|
|
- data: []
|
128
|
|
- };
|
|
133
|
+ if (reset) {
|
|
134
|
+ scope.attributes = {
|
|
135
|
+ count: 0,
|
|
136
|
+ data: []
|
|
137
|
+ };
|
|
138
|
+ }
|
129
|
139
|
scope.checkSubscription();
|
130
|
140
|
scope.attributesDeferred = deviceService.getDeviceAttributes(scope.deviceId, scope.attributeScope.value,
|
131
|
141
|
scope.query, function(attributes, update, apply) {
|
...
|
...
|
|