Extract multiple APIs using id

I have 2 APIs that I want to use simultaneously, API1 and API2.

API2 delivers news feeds to API1, and API1 processes all content in a list form. This means that if you click any list in API1, it will retrieve news feeds from API2 using the identifier that has been defined.

Who can help me here? I am stuck. A screenshot of my code is here: http://i1159.photobucket.com/albums/p637/Apulo_Cosmas/2API.jpg

Many thanks.

+3
source share
2 answers

In the Sencha documentation here (under Digging In): http://docs.sencha.com/touch/2-0/#!/guide/first_app

, ( contentId , description), - - ):

detailCard: {
    xtype: 'panel',
    scrollable: true,
    styleHtmlContent: true
},

listeners: {
    itemtap: function(nestedList, list, index, element, post) {
        this.getDetailCard().setHtml(post.get('description'));
    }
}
+1

, ( API 1) itemtap.

- :

refs: {
  bloglist: 'blog list'
},

control: {
  bloglist: {
    itemtap: 'fetchAPI2'
  }
},
fetchAPI2: function (list,index,target,record){
  id = record.get('contentId'); //this is your id for using API2.
  Ext.data.JsonP.request({
            scope: this,
            url: API2_URL,
            callbackKey: 'callback',
            params: {your params for API2 here},

            callback: function(success,result) {
                           // whatever you want to do here
            }           
        });
}
0

All Articles