Skip to content

Instantly share code, notes, and snippets.

@kimgunnarsson
Created December 21, 2015 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimgunnarsson/02ac86909a95cbb99b82 to your computer and use it in GitHub Desktop.
Save kimgunnarsson/02ac86909a95cbb99b82 to your computer and use it in GitHub Desktop.
define([
// Dojo
"dojo/_base/declare",
"dojo/_base/array",
"dojox/html/entities",
// EPi
"epi-cms/contentediting/editors/SelectionEditor",
// Resources
"epi/i18n!epi/cms/nls/episerver.cms.widget.contentselector"],
function (
// Dojo
declare,
array,
entities,
// EPi
SelectionEditor,
// Resources
res) {
return declare("alloy/editors/SelectionEditor", [SelectionEditor], {
_setSelectionsAttr: function (newSelections) {
this._set("options", array.map(newSelections, function (item) {
return {
label: item.text, //The replaced line
value: item.value,
selected: (item.value == this.value) || (!item.value && !this.value)
};
}, this));
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment