could someone please explain how i can do this? Im trying to get a FB access token and append it to a URL string in a store config. As such...
Ext.define('clubs.store.FacebookEvent', {
extend: 'Ext.data.Store',
requires: [
'clubs.model.FacebookEvent'
],
config: {
autoLoad: true,
model: 'clubs.model.FacebookEvent',
//storeId: 'FacebookEventStore',
proxy: {
type: 'jsonp',
url: 'https://graph.facebook.com/474381199275383/?fields=description,name&access_token=' + getAccessCode(),
reader: {
type: 'json'
//rootProperty: 'data'
}
}
}
});
function getAccessCode(){
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
console.log(accessToken);
}
});
return accessToken;
}
However i seem to always get this error in my JS console...
uncaught Error: The following classes are not declared even if their files have been loaded: 'club.store.FacebookEvent'. Please check the source code of their corresponding files for possible typos:
Am i going about this the wrong way? Any help would be much appreciated!