[OBKMO] Added canDelete property on widgets to disable deleteWidget option.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Thu, 30 Dec 2010 17:41:17 +0100
changeset 9500 10c07f84553f
parent 9499 7191314bb53e
child 9501 15f23ade6a08
[OBKMO] Added canDelete property on widgets to disable deleteWidget option.
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-widget.js
--- a/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-widget.js	Thu Dec 30 14:13:36 2010 +0100
+++ b/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-widget.js	Thu Dec 30 17:41:17 2010 +0100
@@ -126,6 +126,9 @@
         }, {
           title: OB.I18N.getLabel('OBKMO_WMO_DeleteThisWidget'),
           widget: this.widget,
+          enableIf: function (target, menu, item){
+            return this.widget.canDelete;
+          },
           click: function (target, item, menu){
             this.widget.closeClick();
           }
@@ -168,6 +171,7 @@
   showCloseButton: false,
   closeConfirmationMessage: OB.I18N.getLabel('OBKMO_DeleteThisWidgetConfirmation'),
   
+  canDelete: true,
   dbInstanceId: '',
   
   // Parameters handling