Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/369.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript sencha touch ListPaging插件“加载更多”按钮位置问题_Javascript_List_Sencha Touch_Sencha Touch 2 - Fatal编程技术网

Javascript sencha touch ListPaging插件“加载更多”按钮位置问题

Javascript sencha touch ListPaging插件“加载更多”按钮位置问题,javascript,list,sencha-touch,sencha-touch-2,Javascript,List,Sencha Touch,Sencha Touch 2,我正面临一个关于负载位置的问题。。。sencha touch2中的按钮。在这里,使用ListPaging插件添加Load More按钮,并从Ext.plugins.ListPaging文档中声明: 在列表底部添加“加载更多”按钮。当用户 按下此按钮,下一页数据将加载到 存储并附加到列表中 但是,在这里,带有“加载更多”按钮的列表项显示在列表的顶部,而不是底部。 在这里查看我的代码: Ext.define('MyApp.view.MyLIst', { extend : 'E

我正面临一个关于负载位置的问题。。。sencha touch2中的按钮。在这里,使用ListPaging插件添加Load More按钮,并从Ext.plugins.ListPaging文档中声明:

在列表底部添加“加载更多”按钮。当用户 按下此按钮,下一页数据将加载到 存储并附加到列表中

但是,在这里,带有“加载更多”按钮的列表项显示在列表的顶部,而不是底部。 在这里查看我的代码:

Ext.define('MyApp.view.MyLIst', {
            extend : 'Ext.dataview.List',
            xtype : 'mylist',
            id : 'myList' ,
            requires : [Ext.data.Store','Ext.plugin.ListPaging'],

            config : {
                width : '100%',
                height : '100%',
                loadingText : 'Loading data...',
                emptyText : 'No Members',
                itemTpl : '<div class="mylisttitle">{title}</div>',
                store : 'mylistStore',
                plugins : [
                        {
                        xclass : 'Ext.plugin.ListPaging',
                        autoPaging : false,
                        loadNextPage: function() {
                                console.log('Load more button clicked');
                            // fire event here
                            }
                        }],
                masked : false,
                mode : 'SINGLE',
                scrollable : {
                    direction : 'vertical',
                    directionLock : true
                }
            }

        });
并查看以下结果:

知道我如何在列表底部显示相同的按钮吗

谢谢


编辑:我在senchatouch论坛上发布了这个问题,仍然在等待解决方案,你可以看到它有点奇怪。您可以尝试删除这些属性“宽度”、“高度”和“可滚动”,并将layout:fit添加到此列表的父项中。

解决了它:

我错过了这个:无限:真的

“加载更多”按钮现在显示在底部


感谢@blessenm提供:-

如果您有任何自定义css,请尝试禁用它。或者,如果您能够在小提琴中重现相同的问题,则修复起来会更容易。下面是一个工作演示jsfiddle.net/blessenm/9ypwk

Ext.application({
    launch: function () {
        Ext.define('TweetStore', {
            extend: 'Ext.data.Store',

            config: {


         fields: ['from_user', 'profile_image_url', 'text', 'created_at'],

            pageSize: 25,
            autoLoad: true,

            proxy: {
                type: 'jsonp',
                url: 'http://search.twitter.com/search.json',

                pageParam: 'page',
                limitParam: 'rpp',

                extraParams: {
                    q: 'sencha'
                },

                reader: {
                    type: 'json',
                    rootProperty: 'results'
                }
            }
        }
    });

    Ext.define('MyApp.list.List', {
        extend: 'Ext.List',

        config: {
            useSimpleItems: false,
            variableHeights: true,
            infinite: true,
            disableSelection: true,
            allowDeselect: false,
            store: Ext.create('TweetStore'),
            loadingText: 'Loading data...',
            emptyText: 'No Members',

            plugins: [{
                xclass: 'Ext.plugin.ListPaging',
                autoPaging: false
            }],

            itemTpl: Ext.create('Ext.XTemplate',
                '<div>{text}</div>'),
            masked: false,
            mode: 'SINGLE',
            scrollable: {
                direction: 'vertical',
                directionLock: true
            }
        }
    });

    Ext.define('MyApp.list.Container', {
        extend: 'Ext.Container',
        config: {
            fullscreen: true,
            layout: 'vbox',
            items: [{
                xtype: 'titlebar',
                title: 'Load More Plugin',
            }, {
                xclass: 'MyApp.list.List',
                flex: 1
            }]
        }
    });
    Ext.create('MyApp.list.Container');
}
});

嗯,这是我在发布这个问题后做的第一件事。stil没有改变:-如果你有任何自定义css,请尝试禁用它。或者,如果您能够在小提琴中重现相同的问题,则修复起来会更容易。这里是一个工作演示