oPersInfo.setControl(this);
this._oSmartVM.addPersonalizableControl(oPersInfo);
sap.ui.define([
"sap/ui/comp/filterbar/FilterBar",
"sap/ui/comp/smartvariants/PersonalizableInfo",
"sap/ui/comp/smartvariants/SmartVariantManagement"
], function (FilterBar, PersonalizableInfo, SmartVariantManagement) {
"use strict";
var CustomFilterBar = FilterBar.extend("custom.control.FilterBar", {
renderer: function(oRm, oControl) {
FilterBar.getMetadata().getRenderer().render(oRm, oControl);
}
});
/**
* Initialise variant management control
* @private
*/
CustomFilterBar.prototype._initializeVariantManagement = function () {
if (this._oSmartVM && this.getPersistencyKey()) {
var oPersInfo = new PersonalizableInfo({
type: "filterBar",
keyName: "persistencyKey"
});
oPersInfo.setControl(this);
if (this._oSmartVM._loadFlex) {
this._oSmartVM._loadFlex().then(function () {
this._oSmartVM.addPersonalizableControl(oPersInfo);
FilterBar.prototype._initializeVariantManagement.apply(this, arguments);
}.bind(this));
} else {
this._oSmartVM.addPersonalizableControl(oPersInfo);
FilterBar.prototype._initializeVariantManagement.apply(this, arguments);
}
} else {
this.fireInitialise();
}
};
/**
* Use SmartVariantManagement instead of SmartVariantManagementUi2
* Activate the public and apply automatically options
*
* @private
* @returns {sap.ui.comp.smartvariants.SmartVariantManagement} The variant management control
*/
CustomFilterBar.prototype._createVariantManagement = function () {
this._oSmartVM = new SmartVariantManagement({
showExecuteOnSelection: true,
showShare: true
});
return this._oSmartVM;
};
/**
* The original method accepts only SmartVariantManagementUi2
*
* @private
* @returns {boolean} Result
*/
FilterBar.prototype._isTINAFScenario = function() {
if (this._oVariantManagement) {
if (!this._isUi2Mode() && !(this._oVariantManagement instanceof SmartVariantManagement)) {
return true;
}
} else {
/* eslint-disable no-lonely-if */
// scenario: VH dialog: VM replaced with collective search control
if (this._oCollectiveSearch && this.getAdvancedMode()) {
return true;
}
/* eslint-enable no-lonely-if */
}
return false;
};
return CustomFilterBar;
});
this.getView().byId("filterBarId").fireInitialise();
this.getView().byId("filterBarId").registerFetchData(this.onFetchData.bind(this));
this.getView().byId("filterBarId").registerApplyData(this.onApplyData.bind(this));
onFetchData: function () { … }
onApplyData: function (oVariantContent) { … }
onFilterChange: function () {
var oVariantManagement = this.getView().byId("filterBarId").getVariantManagement();
if (oVariantManagement) {
oVariantManagement.currentVariantSetModified(true);
}
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 |