开发者

Sencha Touch + PhoneGap - List not scrolling

开发者 https://www.devze.com 2023-03-20 17:40 出处:网络
I\'m building an app and i\'ve got a list loaded with some info from store, it has a lot of items in it but when I try to scroll down it scrolls back up as if there were not enough items to scroll. He

I'm building an app and i've got a list loaded with some info from store, it has a lot of items in it but when I try to scroll down it scrolls back up as if there were not enough items to scroll. Here is some code:

app.views.SearchTab = Ext.extend(Ext.Panel, {
    iconCls: 'search',
    id: 'search',
    items: {
        xtype: 'list',
        store: app.stores.results,
        scroll: 'vertical',
        itemTpl: '<div class="list_left_panel"><div class="list_photo_wrapper"><div class="list_photo"><img src="http://realio.cz/images/{link}_0s.jpg" /></div></div></div><div class="list_right_panel"><div class="list_name">{titul}</div><div class="list_info"><div>{cena} Kč</div><div class="list_info_grey">{m2} m<sup>2</sup></div><div>{typ}</div></div></div>',
        onItemDisclosure: function (record) {
            Ext.dispatch({
                controller: app.controllers.detail,
                action: 'show',
                id: record.getId()
            });
        }
    },
    initComponent: function() {
        app.stores.results.load();
        app.views.SearchTab.superclass.initComponent.apply(this, arguments);
    }
});

app.models.Results = Ext.regModel("app.models.Results", {
    fields: [
        {name: "titul", type: "string"},
        {name: "book_id", type: "int"},
        ...
        {name: "u", type: "int"}
    ]
});

app.stores.results = new Ext.data.Store({
    model: "app.models.Results",
    proxy: {
        type: 'ajax',
        url: 'http://site.com/json_list2.php?...',
        reader: {
            type: 'json',
            root: 'markers'
   开发者_开发百科     }
    },
    autoLoad: false
});

How can i fix the list so that it scrolls correctly? Thanks.


add this library this will help you: https://github.com/Lioarlan/UxBufList-Sench-Touch-Extension

0

精彩评论

暂无评论...
验证码 换一张
取 消