kyle
kyle

Reputation: 368

sencha touch dynamic list through JSONP

We have started development on a sencha touch app. Part of our app includes a browse feature. There are a few starting points, but we want everything after that to be dynamically loaded on request. The structure of the data is infinitely recursive, so creating a full file, ignoring size, is literally impossible.

Given that, a store doesn't seem possible since the data isn't actually heirchical. What we want to do is tap sends new JSONP request to return the new list based on the tapped item. Swipe will return items as a list, paginated, which will actually have leaf nodes.

We do not need to cache the results or keep a map, back will take you to the starting point no matter how far you go.

I understand nestedlist being based on heirarchical data and we don't have that. I looked at just sending a new request and applying a template to a panel with the new data, but we do want the slide transition. What approach should we take?

Upvotes: 2

Views: 731

Answers (1)

ilija139
ilija139

Reputation: 2974

You already have the answer there - just have a template and apply the new data on that. To achieve the slide transition have two cards and switch between them. See my code for example.

App.view.CustomCard = Ext.extend(Ext.Panel, {
        id: 'customCard',
        layout:'card', //important
        cardSwitchAnimation: 'slide', //important
        initComponent: function() {
          Ext.apply(this, {
                defaults: {xtype: 'panel'},
        items: [
            { html:'FirstPanel'},
            { html:'SecondPanel'}
            ]
           });
          }});

Then listen for the tap or swipe events on the first panel, make new request and fill that data in the second panel.

Note to switch between cards use Ext.getCmp('customCard').setActiveItem(0);

Upvotes: 1

Related Questions