Skip to content

Commit 43e1a27

Browse files
committed
SUPPORT-130 [TABLE] No sorting showing in the list when click on header
work around an angular bug: angular/angular.js#15422 when adding watches in a watch, then angular skips watches that only executes the next time. (and the next and the next if the skipped watches would add watches again)
1 parent 3fffe56 commit 43e1a27

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

servoy_ngclient/war/servoyservices/foundset_linked_property/foundsetLinked.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,14 @@ angular.module('foundset_linked_property', ['webSocketModule', 'servoyApp', 'fou
141141
initialVPSize = -1;
142142
if (!angular.isDefined(newV)) newV = 0;
143143

144-
$viewportModule.removeDataWatchesFromRows(newValue.length, internalState);
145-
generateWholeViewportFromOneValue(newV);
146-
updateWholeViewport();
147-
$viewportModule.addDataWatchesToRows(newValue, internalState, componentScope, true, internalState[PUSH_TO_SERVER]);
144+
if (componentScope) {
145+
componentScope.$evalAsync(function(){
146+
$viewportModule.removeDataWatchesFromRows(newValue.length, internalState);
147+
generateWholeViewportFromOneValue(newV);
148+
updateWholeViewport();
149+
$viewportModule.addDataWatchesToRows(newValue, internalState, componentScope, true, internalState[PUSH_TO_SERVER]);
150+
})
151+
}
148152
});
149153
} else if (angular.isDefined(serverJSONValue[VIEWPORT_VALUE])) {
150154
internalState.recordLinked = true;

0 commit comments

Comments
 (0)