Hi!
I use some objects in separate files to support application logic. For example:
define([], function(){
return {
name:"",
getPetName: function(id){
webix.ajax().post("server/pets.php?cmd=get-name", {id: id},
webix.bind(function(text, data){
var response = data.json();
this.name = response.name;
}
), this);
}
}
}
But the assignment of the value of the variable “name” does not occur, because scope in this case - “window”.
How to solve the problem of accessing variables from a query and calling the functions of this object?