Hi Boris,
I have modified one of your test files to include prop nameChar_count...to show that the below scenario works...although I don't have a refresh method showing it's usage. I do have this implemented in my app though.
https://jsfiddle.net/alnico/25fuckt3/ LOL, jsfiddle generated the f-word in its link :-)
Property comment is not initialized by data and therefore does not update on refresh (by design).
Property nameChar_count is initialized by data AND calls method/function using this for defaultVal. This works with refresh which I need...a computed property.
Calling a standard function works of course too, but I have a case where I needed to parse an array...etc whereas using a 'method' I don't and is much cleaner and encapsulated.
So essentially nameChar_count is called via extend AND is processed via defaultVal.
I have not seen this documented anywhere (doing both of these things) and wonder if this is unconventional (not by design)...although it works?
getters: [
{getter: "name", defaultVal: "No name"}, // Compiled name() get/set
{getter: "nameChar_count", defaultVal: this.nameChar_count },
],
extend: {
name: myNameGetSet, // Override name() get/set
comment: comment, // Additional get/set property, not initialized by data)
nameChar_count: function() {
return this.name().length;
}
}
Thanks,
Brent
Hi Boris,
I have modified one of your test files to include prop
nameChar_count...to show that the below scenario works...although I don't have a refresh method showing it's usage. I do have this implemented in my app though.https://jsfiddle.net/alnico/25fuckt3/ LOL, jsfiddle generated the f-word in its link :-)
Property
commentis not initialized by data and therefore does not update onrefresh(by design).Property
nameChar_countis initialized by data AND calls method/function using this fordefaultVal. This works withrefreshwhich I need...a computed property.Calling a standard function works of course too, but I have a case where I needed to parse an array...etc whereas using a 'method' I don't and is much cleaner and encapsulated.
So essentially
nameChar_countis called viaextendAND is processed viadefaultVal.I have not seen this documented anywhere (doing both of these things) and wonder if this is unconventional (not by design)...although it works?
Thanks,
Brent