Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/BootstrapMultiSelectForMendix/BootstrapMultiSelect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,18 @@ iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lD
<category>Display</category>
<description>The maximum number of selected items to display in the field before being replaced with the text 'n selected'</description>
</property>
<property key="disabled" type="boolean" defaultValue="false">

<property key="disabled" type="enumeration" defaultValue="security">
<caption>Disabled</caption>
<category>Display</category>
<description>If true, makes the control disabled.</description>
<enumerationValues>
<enumerationValue key="no">No</enumerationValue>
<enumerationValue key="security">Based on security</enumerationValue>
<enumerationValue key="attribute">Based on attribute</enumerationValue>
</enumerationValues>
</property>

<property key="disabledViaAttribute" type="attribute" required="false">
<caption>Disabled via attribute</caption>
<category>Display</category>
Expand Down
28 changes: 18 additions & 10 deletions src/BootstrapMultiSelectForMendix/widget/BootstrapMultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,20 +245,28 @@ define( [

_updateControlDisplay : function(){
// fixed property gets checked first
if(this.disabled){
this._$combo.multiselect('disable');

} else{

// <enumerationValue key="no">No</enumerationValue>
// <enumerationValue key="security">Based on security</enumerationValue>
// <enumerationValue key="attribute">Based on attribute</enumerationValue>

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){
Expand Down
Binary file modified test/Test.mpr
Binary file not shown.
Binary file modified test/widgets/BootstrapMultiSelectForMendix.mpk
Binary file not shown.