Created
October 7, 2016 07:59
-
-
Save StErMi/a3153c359ad343b1b7bb1ada29efdf05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @module it/designfuture/framework/controls | |
* @author Emanuele Ricci <stermi@gmail.com> | |
* @version 0.0.1 | |
*/ | |
// Provides control it.designfuture.framework.controls.DFStandardListItem. | |
sap.ui.define([ | |
'sap/m/StandardListItem' | |
], function(StandardListItem) { | |
"use strict"; | |
/** | |
* Constructor for a new DFStandardListItem. | |
* | |
* @param {string} [sId] Id for the new control, generated automatically if no id is given | |
* @param {object} [mSettings] Initial settings for the new control | |
* | |
* @class | |
* <code>sap.m.DFStandardListItem</code> is a list item providing the most common use cases, e.g. image, title and description. | |
* @extends sap.m.StandardListItem | |
* | |
* @constructor | |
* @public | |
* @alias it.designfuture.framework.controls.DFStandardListItem | |
*/ | |
var DFStandardListItem = StandardListItem.extend("it.designfuture.framework.controls.DFStandardListItem", { | |
metadata : { | |
properties : { | |
/** | |
* Whether the control should be enabled. If set to false, the item is rendered as disabled. | |
*/ | |
enabled : {type : "boolean", group : "Appearance", defaultValue : true} | |
} | |
}, | |
aggregations: {}, | |
events: {}, | |
renderer: {} | |
}); | |
/** | |
* Override getMultiSelectControl to enable/disable the StandardListItem | |
* | |
* @alias DFStandardListItem#getMultiSelectControl | |
* @function | |
*/ | |
DFStandardListItem.prototype.getMultiSelectControl = function() { | |
var control = StandardListItem.prototype.getMultiSelectControl.apply(this, arguments); | |
control.setEnabled( this.getEnabled() ); | |
return control; | |
}; | |
/** | |
* Override getSingleSelectControl to enable/disable the StandardListItem | |
* | |
* @alias DFStandardListItem#getSingleSelectControl | |
* @function | |
*/ | |
DFStandardListItem.prototype.getSingleSelectControl = function() { | |
var control = StandardListItem.prototype.getSingleSelectControl.apply(this, arguments); | |
control.setEnabled( this.getEnabled() ); | |
return control; | |
}; | |
return DFStandardListItem; | |
}, /* bExport= */ true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment