details:   https://code.openbravo.com/erp/devel/pi/rev/442d564cc845
changeset: 34910:442d564cc845
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Tue Oct 30 13:58:35 2018 +0100
summary:   fixes issue 39426: Duplicated DS call after drawing an 
OBMultiCalendar

  By default OBCalendar has the autoFetchData parameter set to true. This means 
that when an OBCalendar is first drawn, this.fetchData() is automatically 
called.

  In the case of the OBCalendar used by the OBMultiCalendar, the data is being 
manually fetched on its initialization by invoking this.refreshCalendar(). This 
call together with the call performed with the autoFetchData caused the double 
DS call.

  In general it is recommended to turn off autoFetchData if we are going to 
manually call fetchData() at any time. For this reason, we are disabling the 
autoFetchData in the OBCalendar used by the OBMultiCalendar.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-multicalendar.js
 |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r ade8b8bcc3e7 -r 442d564cc845 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-multicalendar.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-multicalendar.js
     Tue Oct 30 10:39:35 2018 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-multicalendar.js
     Tue Oct 30 13:58:35 2018 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2013 Openbravo SLU
+ * All portions are Copyright (C) 2013-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -694,7 +694,8 @@
     });
     this.calendar = 
isc.OBMultiCalendarCalendar.create(isc.addProperties(this.calendarProps, {
       multiCalendar: this,
-      lanes: initialLanes
+      lanes: initialLanes,
+      autoFetchData: false
     }));
 
     this.setLoading(false);


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to