diff --git a/src/BootstrapMultiSelectForMendix/BootstrapMultiSelect.xml b/src/BootstrapMultiSelectForMendix/BootstrapMultiSelect.xml index 3440713..4306afc 100644 --- a/src/BootstrapMultiSelectForMendix/BootstrapMultiSelect.xml +++ b/src/BootstrapMultiSelectForMendix/BootstrapMultiSelect.xml @@ -180,11 +180,18 @@ iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lD Display The maximum number of selected items to display in the field before being replaced with the text 'n selected' - + + Disabled Display If true, makes the control disabled. + + No + Based on security + Based on attribute + + Disabled via attribute Display diff --git a/src/BootstrapMultiSelectForMendix/widget/BootstrapMultiSelect.js b/src/BootstrapMultiSelectForMendix/widget/BootstrapMultiSelect.js index 2781acc..57213a7 100644 --- a/src/BootstrapMultiSelectForMendix/widget/BootstrapMultiSelect.js +++ b/src/BootstrapMultiSelectForMendix/widget/BootstrapMultiSelect.js @@ -245,20 +245,28 @@ define( [ _updateControlDisplay : function(){ // fixed property gets checked first - if(this.disabled){ - this._$combo.multiselect('disable'); - - } else{ + +// No +// Based on security +// Based on attribute + + if(this.disabled === 'no'){ this._$combo.multiselect('enable'); - } - // attribute property beats fixed property - if(this.disabledViaAttribute){ - if(this._contextObj.get(this.disabledViaAttribute) ){ + } else if(this.disabled === 'security') { + // Check the security + if(this._contextObj.isReadonlyAttr(this._reference)){ + this._$combo.multiselect('disable'); + } else { + this._$combo.multiselect('enable'); + } + } else if(this.disabled === 'attribute' && this.disabledViaAttribute){ + // attribute property beats fixed property + if(this._contextObj.get(this.disabledViaAttribute)){ this._$combo.multiselect('disable'); - } else{ + } else { this._$combo.multiselect('enable'); } - } + } // fixed property gets checked first if(this.visible){ diff --git a/test/Test.mpr b/test/Test.mpr index a6c3562..4c9bd2f 100644 Binary files a/test/Test.mpr and b/test/Test.mpr differ diff --git a/test/widgets/BootstrapMultiSelectForMendix.mpk b/test/widgets/BootstrapMultiSelectForMendix.mpk index 3f6e824..9516f90 100644 Binary files a/test/widgets/BootstrapMultiSelectForMendix.mpk and b/test/widgets/BootstrapMultiSelectForMendix.mpk differ