Не работает Ext.data.field.Field.calculate()?
Воспроизведение бага в песочнице
https://fiddle.sencha.com/#fiddle/19h3
Ext.define("Employee", {
extend: "Ext.data.Model",
fields: [{
name: "username",
type: "string"
}, {
name: "name",
type: "string",
calculate: function(data) {
console.log("calculate", data)
var tpl = "{personlastname} {personname} {personmiddle}";
return new Ext.Template(tpl).apply(data);
}
}, {
name: "personlastname",
type: "string",
}, {
name: "personname",
type: "string"
}, {
name: "personmiddle",
type: "string"
}]
});
var e = new Employee();
e.set("personlastname", "Jon");
e.set("personname", "Silver");
e.set("personmiddle", "Bob");
console.log("name =", e.get("name")); // Должен был показать "Jon Silver Bob"
https://www.sencha.com/forum/showthr...#post113 3954