extjs - Yelp API key not working in Sencha Architect demo code -
i using tutorial here : http://docs.sencha.com/architect/3/tutorials/first_mobile_application.html#the_controller
getbusinesses: function(location, callback) { // note: obtain yelp api key registering (for free) // yelp @ http://www.yelp.com/developers/getting_started/api_overview // (in app, use review search api v1.0) var store = ext.data.storemanager.lookup('businessstore'), yelpkey = '', // enter yelp api key here url = 'http://api.yelp.com/business_review_search' + '?ywsid=' + yelpkey + '&term=bars' + '&lat=' + location.coords.latitude + '&long=' + location.coords.longitude; store.getproxy().seturl(url); store.load(function() { callback(store); }); }
i applied api key on yelp , got following:
i not sure 1 use. tutorial code has placeholder 1 single key in code above
the completed app shows error: uncaught typeerror: cannot read property 'setstore' of undefined at:
me.getbusinesses(location, function (store) { // bind data list , display me.getdatalist().setstore(store);
- you need api v1.0 key.
getdatalist()
returns undefined because view not exist. may have forgotten name list view in listcontainer, see "list view - step 4". also, function name derived whatever set reference in *"the controller - step 7". namingdatalist
make functiongetdatalist()
, whereas namingdatalist
makegetdatalist()
. note capital "l".
hope helps others running problem.
Comments
Post a Comment