Skip to content

Commit 3fae7ca

Browse files
committed
SUPPORT-129 [TABLE]No update row in list after change and save the value
for a field added the same listeners for viewport changes on the foundset itself as in the foundset linked Conflicts: servoy_ngclient/war/servoyservices/foundset_custom_property/foundset.js
1 parent b4b3f5b commit 3fae7ca

File tree

1 file changed

+16
-0
lines changed
  • servoy_ngclient/war/servoyservices/foundset_custom_property

1 file changed

+16
-0
lines changed

servoy_ngclient/war/servoyservices/foundset_custom_property/foundset.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ angular.module('foundset_custom_property', ['webSocketModule'])
137137
viewPortUpdate[CONVERSIONS] && viewPortUpdate[CONVERSIONS][ROWS] ? viewPortUpdate[CONVERSIONS][ROWS] : undefined, componentScope, componentModelGetter);
138138
} else if (angular.isDefined(viewPortUpdate[UPDATE_PREFIX + ROWS])) {
139139
$viewportModule.updateViewportGranularly(currentClientValue[VIEW_PORT][ROWS], internalState, viewPortUpdate[UPDATE_PREFIX + ROWS], viewPortUpdate[CONVERSIONS] && viewPortUpdate[CONVERSIONS][UPDATE_PREFIX + ROWS] ? viewPortUpdate[CONVERSIONS][UPDATE_PREFIX + ROWS] : undefined, componentScope, componentModelGetter, false);
140+
internalState.fireChanges(viewPortUpdate[UPDATE_PREFIX + ROWS]);
140141
}
141142
}
142143

@@ -236,6 +237,21 @@ angular.module('foundset_custom_property', ['webSocketModule'])
236237

237238
return internalState.selectionUpdateDefer.promise;
238239
}
240+
var changeListeners = [];
241+
newValue.addChangeListener = function(listener) {
242+
changeListeners.push(listener);
243+
}
244+
newValue.removeChangeListener = function(listener) {
245+
var index = changeListeners.indexOf(listener);
246+
if (index > -1) {
247+
changeListeners.splice(index, 1);
248+
}
249+
}
250+
internalState.fireChanges = function(values) {
251+
for(var i=0;i<changeListeners.length;i++) {
252+
changeListeners[i](values);
253+
}
254+
}
239255
// PRIVATE STATE AND IMPL for $sabloConverters (so something components shouldn't use)
240256
// $sabloConverters setup
241257
internalState.setChangeNotifier = function(changeNotifier) {

0 commit comments

Comments
 (0)