diff --git a/org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/ValueFieldAdapter.js b/org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/ValueFieldAdapter.js index 2399f0eeff2..ac40c11226a 100644 --- a/org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/ValueFieldAdapter.js +++ b/org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/ValueFieldAdapter.js @@ -46,20 +46,3 @@ scout.ValueFieldAdapter.prototype._syncDisplayText = function(displayText) { this.widget.setDisplayText(displayText); this.widget.parseAndSetValue(displayText); }; - -scout.ValueFieldAdapter.prototype._createPropertySortFunc = function(order) { - return function(a, b) { - var ia = order.indexOf(a); - var ib = order.indexOf(b); - if (ia > -1 && ib > -1) { // both are in the list - return ia - ib; - } - if (ia > -1) { // B is not in list - return -1; - } - if (ib > -1) { // A is not in list - return 1; - } - return scout.comparators.TEXT.compare(a, b); // both are not in list - }; -}; diff --git a/org.eclipse.scout.rt.ui.html/src/main/js/scout/planner/PlannerAdapter.js b/org.eclipse.scout.rt.ui.html/src/main/js/scout/planner/PlannerAdapter.js index 1648736c2fd..8334584536d 100644 --- a/org.eclipse.scout.rt.ui.html/src/main/js/scout/planner/PlannerAdapter.js +++ b/org.eclipse.scout.rt.ui.html/src/main/js/scout/planner/PlannerAdapter.js @@ -14,6 +14,12 @@ scout.PlannerAdapter = function() { }; scout.inherits(scout.PlannerAdapter, scout.ModelAdapter); +scout.PlannerAdapter.PROPERTIES_ORDER = ['displayMode', 'viewRange']; + +scout.PlannerAdapter.prototype._orderPropertyNamesOnSync = function(newProperties) { + return Object.keys(newProperties).sort(this._createPropertySortFunc(scout.PlannerAdapter.PROPERTIES_ORDER)); +}; + scout.PlannerAdapter.prototype._sendViewRange = function(viewRange) { this._send('property', { viewRange: scout.dates.toJsonDateRange(viewRange) diff --git a/org.eclipse.scout.rt.ui.html/src/main/js/scout/session/ModelAdapter.js b/org.eclipse.scout.rt.ui.html/src/main/js/scout/session/ModelAdapter.js index 2ab4242447c..5d4fd457c53 100644 --- a/org.eclipse.scout.rt.ui.html/src/main/js/scout/session/ModelAdapter.js +++ b/org.eclipse.scout.rt.ui.html/src/main/js/scout/session/ModelAdapter.js @@ -357,6 +357,23 @@ scout.ModelAdapter.prototype._orderPropertyNamesOnSync = function(newProperties) return Object.keys(newProperties); }; +scout.ModelAdapter.prototype._createPropertySortFunc = function(order) { + return function(a, b) { + var ia = order.indexOf(a); + var ib = order.indexOf(b); + if (ia > -1 && ib > -1) { // both are in the list + return ia - ib; + } + if (ia > -1) { // B is not in list + return -1; + } + if (ib > -1) { // A is not in list + return 1; + } + return scout.comparators.TEXT.compare(a, b); // both are not in list + }; +}; + /** * Called by Session.js for every event from the model */