Hello,
In phone.js
I am using this API to get the user Object.
$.getJSON('User/' + this.model.get('assignedUserId'), function (json) {
this.model.set('confident',json.region);
});
How to set the result json.region into model?
setup: function () {
this.dataFieldName = this.name + 'Data';
this.defaultType = this.defaultType || this.getMetadata().get('entityDefs.' + this.model.name + '.fields.' + this.name + '.defaultType');
if (this.model.has('doNotCall')) {
this.listenTo(this.model, 'change:doNotCall', function (model, value, o) {
if (this.mode !== 'detail' && this.mode !== 'list') return;
if (!o.ui) return;
this.reRender();
}, this);
}
$.getJSON('User/' + this.model.get('assignedUserId'), function (json) {
this.model.set('confident',json.region);
});
},
I get the ERROR in console : Uncaught TypeError: Cannot read property 'set' of undefined
How to fix this?
Thanks.
In phone.js
I am using this API to get the user Object.
$.getJSON('User/' + this.model.get('assignedUserId'), function (json) {
this.model.set('confident',json.region);
});
How to set the result json.region into model?
setup: function () {
this.dataFieldName = this.name + 'Data';
this.defaultType = this.defaultType || this.getMetadata().get('entityDefs.' + this.model.name + '.fields.' + this.name + '.defaultType');
if (this.model.has('doNotCall')) {
this.listenTo(this.model, 'change:doNotCall', function (model, value, o) {
if (this.mode !== 'detail' && this.mode !== 'list') return;
if (!o.ui) return;
this.reRender();
}, this);
}
$.getJSON('User/' + this.model.get('assignedUserId'), function (json) {
this.model.set('confident',json.region);
});
},
I get the ERROR in console : Uncaught TypeError: Cannot read property 'set' of undefined
How to fix this?
Thanks.
Comment