November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
Hi,
What I actually need is to be able to either:
- access $this.name in a function that I would call in helptext: function() { return giveMeTranslationForPageType(this.name); }, or
- declare var pageTypeName = someObject.name; above return declare("alloy.editors.StringList", ...., so that I can access it in helptext: function().
I am a backend developer, so pardon my lack of js knowledge :/
Got it! Perhaps there is a nicer way (if so, let me know), but the problem is fixed by adding data-dojo-attach-point to a helptext span and setting its innertext in postCreate event.
templateString: "<div class=\"dijitInline\">\
<div data-dojo-attach-point=\"stateNode, tooltipNode\">\
<div data-dojo-attach-point=\"textArea\" data-dojo-type=\"dijit.form.Textarea\" style=\"width: 300px\"></div>\
</div>\
<br />\
<span data-dojo-attach-point=\"helpTextLabel\">${helptext}</span>\
</div>",
...
helptext: "Separera objekt ovan genom radbrytningar",
...
postCreate: function () {
// call base implementation
this.inherited(arguments);
...
var translationUrl = '/api/translation/GetTranslationsOnDemand?id=' + this.name;
var label = this.helpTextLabel;
$.getJSON(translationUrl, function (data) {
if (data != 'undefined') { label.innerHTML = data; }
});
},
I have used PropertyStringList from AlloyTech template.
Now, bellow this property, it's written "Place items in separate lines".
How can I customize this per property? I have an ApiController for fetching custom translations, so I could just call the controller based on the property name. But, I don't have the reference to the name.
What I basically want is just a possibility to call a function with property name. Any clues?