Hello,
I am extending dojo's dojox.data.JsonRestStore and I want to provide my own fixed scheme.
this is getUsername won't work because it doesn't refer to the current datastore
Take a look at this code:
/**
* @author user
*/
dojo.provide("cms.user.UserAuthenticationStore");
dojo.require("dojox.data.JsonRestStore");
dojo.declare("cms.user.UserAuthenticationStore", [dojox.data.JsonRestStore], {
schema: {
prototype: {
getUsername: function(){
return ???.getValue(this, "username");
}
}
}
});
Can you tell me what to replace ??? with?
EDIT:
Here's the code that works but it's ugly as hell, can someone tell me how to fix this?
/**
* @author user
*/
dojo.provide("cms.user.UserAuthenticationStore");
dojo.require("dojox.data.JsonRestStore");
dojo.declare("cms.user.UserAuthenticationStore", [dojox.data.JsonRestStore], {
schema: {
prototype: {}
},
constructor: function(){
var that = this;
this.schema.prototype.getUsername = function(){
return that.getValue(this, "username");
}
}
});