N°931 TagSet widget : disable/enable methods for mass edit (need to be plugged, but where ?!??)

This commit is contained in:
Pierre Goiffon
2018-09-14 17:21:06 +02:00
parent 875c77ae65
commit ec38473d88

View File

@@ -78,6 +78,8 @@ $.widget('itop.tagset_widget',
/** will hold all interactions done : code as key and one of STATUS_* constant as value */
tagSetCodesStatus: null,
selectizeWidget: null,
// the constructor
_create: function () {
var $this = this.element;
@@ -137,6 +139,8 @@ $.widget('itop.tagset_widget',
tagSetWidget._onTagRemove(value, selectizeWidget);
}
});
this.selectizeWidget = $inputWidget[0].selectize; // keeping this for widget public methods
},
refresh: function () {
@@ -166,6 +170,14 @@ $.widget('itop.tagset_widget',
this.element.val(JSON.stringify(widgetPublicData, null, (this.options.isDebug ? 2 : null)));
},
disable: function () {
this.selectizeWidget.disable();
},
enable: function () {
this.selectizeWidget.enable();
},
/**
* Updating items to have a specific rendering for partial codes.<br>
* At first I was thinking about using the Selectize render callback, but it is called before onItemAdd/onItemRemove :(<br>