sencha list paging plugin load more

vue mint-ui源码解析之loadmore组件 接入 官方接入文档mint-ui loadmore文档 接入使用Examplehtml<div id="app"> <mt-loadmore :top-method="loadTop" :bottom-method="loadBottom" :bottom-all-loaded="allLoaded" :max-distance="150" @top-sta 阅读详情


I'm trying to use sencha touch's listpaging plugin. But there is almost no good( or bad ) documentation about how to use it and i'm confused.

When i activate the plugin in my list

this.myList = new Ext.List({
  store: this.myStore,
  plugins: [{
    ptype: 'listpaging',
    autoPaging: false
  }],
  itemTpl: '...'
});

a 'Load More' text and a loading image is added to the end of the list.

But i don't know how to configure my store to enable this plugin to be able to load more data.

App.regStore('MyStore', {
 model: 'myModel',
 proxy: {
    type: 'ajax',
    url: 'http://mydomain.com/json?howmany=10&page=1',
    reader: {
        type: 'json',
        root: 'results'
    }
  }
});

App.stores.myStore = Ext.StoreMgr.get('MyStore');

How can i configure my store so when i tap "Load more", the store brings up page 2 and add them to the list automatically?

link | improve this question

 
Was this post useful to you?      

3 Answers

up vote 0 down vote accepted

I'm having problems finding good documentation, too, but I can at least answer your question. You need to add pageSize to your store, clearOnPageLoad as well, if you want to not clear out what was already loaded. Her's my code:

Ext.regStore('publicresources', {

model: 'PublicResource',
autoLoad:false,
remoteFilter:true,
sortOnFilter:true,
    pageSize: 15,
    clearOnPageLoad: false, 
sorters: [
    {
        property : 'distance',
        direction: 'ASC'
    }
]

});

My outstanding issues that I'm looking into are:

  1. How to turn off the "More" element when there are no more records to load
  2. How to detect that there are no more records to load, and where to put that detection code.
  3. How to keep the list at the location that the user was at. Each load jumps back to the 1st item in the list

Good luck!

link | improve this answer
 
Thanks for your answer, also please let me know if anything else comes up. –  keune  Sep 9 '11 at 19:44
 
item 3 in my outstanding items was a fault of my code. I had a piece of code that would force bringing the the user back to the top of the list on refresh of the data, so as to avoid another rendering error with sencha touch's list component. The bug manifests when the data replacing the list is less than what was originally there, causing the list to misrender. –  John Gordon  Sep 28 '11 at 12:42
 
Have you been able to find a solution to your first issue: "How to turn off the "More" element when there are no more records to load"? –  Ross  Feb 29 at 4:53
feedback

Remember also that this works only server side currently.

Forum thread http://www.sencha.com/forum/showthread.php?105193-Store-pageSize

link | improve this answer
 
feedback

I've had a similar issue with the ListPaging plugin in SenchaTouch 2, and managed to sort out the 'load more' message behaviour when the end of the data set is reached.

This builds on what John Gordon has come up with (regarding specifying the pageSize andclearOnPageLoad config options), since these properties seem to be the same in Senchatouch 2. I haven't looked at SenchaTouch 1.x in detail. In SenchaTouch 2, all config options must be defined in aconfig property:

Ext.define('MessagingApp.store.MessageThreads', {
    extend  : 'Ext.data.Store',
    requires: ['MessagingApp.model.MessageThread'],

    config:
    {
        model: 'MessagingApp.model.MessageThread',

        autoLoad: false,
        clearOnPageLoad: false,  // This is true by default
        pageSize: 10,            // This needs to be set for paging

        proxy: {
            type: 'jsonp',
            pageParam: 'currentPage',
            limitParam: 'pageSize',
            url: APIURL + '/message-app-service/GetMessageThreads',
            reader: {
                type: 'json',
                rootProperty: 'Data'
            }
        }
    }
});

In the view, where we specify the plugins, we can override the 'load more' and 'no more records' messages:

{
    xtype:'dataview',
    store:'MessageThreads',
    id:'threadList',
    itemTpl:Ext.create('Ext.XTemplate',
        '<!-- template markup goes here -->',
        {
            //custom helper functions here
        }
    ),
    plugins:[
        {
            xclass:'Ext.plugin.ListPaging',
            autoPaging: true,

            // These override the text; use CSS for styling
            loadMoreText: 'Loading...',
            noMoreRecordsText: 'All messages loaded'
        }
    ]
}

The issue is that while our web service returns an array of records for a particular page, there is no overall total count property, which is needed for the plugin to determine when all records have been loaded. Hence as it is, the 'Load more' message will remain (issue #1 in the accepted solution). So in theinit function of our controller, we have to attach an event handler for the load event on the store to hook into when a new page of data is received:

Ext.define('MessagingApp.controller.Messages',
{
    extend: 'Ext.app.Controller',

    config:
    {
        views: [
            'MessageThreads',
            // Other views referenced by this controller
        ],

        stores: [
            'MessageThreads'
        ],

        refs:
        {
            // References to UI elements by selector...
        }
    },

    init: function() {
        // Other internal initialisation...

        this.control(
        {
            // Selector-object pairs...
        });

        // Provide a means to intercept loads of each page of records
        var threadStore = Ext.getStore('MessageThreads');
        threadStore.addBeforeListener('load', this.checkForThreadListEnd, this);
    },

    // Remaining controller functions...

});

In the handler, we realise that we've reached the end of the data set when the number of records returned is less than the page size. If the total record count is a multiple of the page size, the last 'page' will have an empty array. Once the end of the data set has been identified, we update the totalCountconfig property of the store:

checkForThreadListEnd: function(store, records, isSuccessful) {
    var pageSize = store.getPageSize();
    var pageIndex = store.currentPage - 1;    // Page numbers start at 1

    if(isSuccessful && records.length < pageSize)
    {
        //Set count to disable 'loading' message
        var totalRecords = pageIndex * pageSize + records.length;
        store.setTotalCount(totalRecords);
    }
    else
        store.setTotalCount(null);
},

// Other controller functions...

Because this is a 'before' event handler, this property will be crucially updated before the plugin decides whether to display the 'load more' or 'no more records' messages. Unfortunately, the framework doesn't provide a means to hide the 'no more records' message, so this would have to be done via CSS.

Hope this helps.

link | improve this answer
 
Thanks for d_mcg solution. there is other issue: the "No more records" link 's still clickable and it sends a request to the server once clicked. How do you resolve this ? many thanks :) –  Bogie  Mar 29 at 2:46
 
You're welcome :-) I haven't found an easy way to disable that button, mainly because SenchaTouch only provides the means to set the text of this button in either state (which is applied via an XTemplate in the 'private'loadTpl config property). You may be able to work some magic to intercept the tap event of this button and return false (which cancels the event), or use a funky CSS selector to hide the button in its 'no more records' state. You can see the internals of how Sencha does it at docs.sencha.com –  d_mcg  Mar 30 at 10:59
 
Forgot to say - you can hover over the green heading (i.e. the class name) to reveal the "View source..." link for that class. I've found that very helpful for figuring out some of the extra details that the documentation doesn't mention. –  d_mcg  Mar 30 at 11:07
feedback


load_More(点击加载更多) 点击加载跟多 立即下载

相关推荐

CSP-J 入门级第一轮认证 2025 详细解析

2025年CSP-J入门级第一轮认证模拟赛提供10套免费试题,含选择题与解析。选择题涉及计算机科学基础,如32位无符号整数最大值计算(约42.9亿,选A)、C++位运算(255&254=254,选B)、递归函数分析(calc(5)=6,选B)、哈夫曼树构造(带权路径长度186,选B)等。其他题目涵盖图论(有向图边数等于入度/出度和,选B)、组合数学(120种选法,选C)、布尔逻辑(选项C不恒等)、模运算周期性(f[2025]=6,选D)、C++字符串特性(支持string+char,选B)及引用传参

lan_in的博客 2947

el-select懒加载(自定义指令loadmore),重磅:实现回显未加载的数据!

1、自定义指令 1、创建directives.js,放在utils文件夹下;代码如下: import Vue from 'vue' Vue.directive('loadmore', { bind (el, binding) { const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdow...

m0_46938695的博客 3312

生信人填坑记 orthofinder的安装和基础使用

其中常用的有两个结果,第一个是Orthogroups文件夹下的Orthogroups.GeneCount.tsv,这个文件里保存着每个家族在每个物种里的成员数量。(写到这儿饭点到了,吃饭要紧…在国内使用conda的同学我相信很多人都会遇到-|- -|- -|- -|- -|- -|- -|- -|- 一直转圈。软件的是由很简单,将你要跑的物种的蛋白质文件放在work/data目录下,文件名都用物种缩写,后缀统一就行。当然,很多软件都会自带一个这样的文件,conda装不了的时候可以去软件官网溜达溜达。

qq_43337286的博客 5382

uniapp - load-more触底加载,下拉刷新

底部加载load-more(uni-ui组件),三个状态:more、loading、nomore 触底事件:onReachBottom 下拉刷新:onPullDownRefresh,停止下拉刷新uni.stopPullDownRefresh() <template> <view> <!-- 底部加载,三个状态:more、loading、nomore --> <uni-load-more :status="status"></u

欢迎来到猫猫的博客 o_o ,如有问题,欢迎提出改正~ 3286

开源大模型推理GPU资源评估以及优化

随着大模型的火热很多项目中都使用到了开源大模型,这时候准确评估大模型的GPU资源非常重要,主要有下面几个方面:GPU是昂贵的资源。高估内存需求可能导致在硬件上的不必要支出,而低估则可能导致系统故障或性能下降。:适当的内存管理确保模型高效运行,能够更快地响应用户并处理更多并发请求。:随着需求的增长,理解内存需求对于在不牺牲性能或产生高昂成本的情况下扩展服务至关重要。尽管其重要性显而易见,但计算用于服务大型语言模型(LLM)的GPU内存并不简单。

优快云DN的博客 3118

PCIe网卡驱动实现分析(三)--- cache一致性

在现代处理器系统中,CPU的主频远高于主存读写速度,主存的读写速度成为程序执行效率的瓶颈;为了解决这个问题,在CPU和主存之间引入了Cache存储器,基于程序执行的局部性原理,在程序执行时,将正在使用的数据从主存拷贝一份到Cache,这样CPU就可以直接从Cache读写数据以改善主存读写速度慢的问题;

a935854743的博客 1779

【Vue】自定义loadmore指令实现下拉加载更多

使用自定义指令loadmore,实现下拉加载更多。 首先是loadmore.js, el 为绑定的元素,通过el.scrollHeight - el.offsetHeight === el.scrollTop判断滚动条到达底部,这里引入了loadsash实现节流,以免每一次滚动到底部都加载数据(手抖或故意滚动),加入flag字段,控制首次触底后直接执行,后续的触底至少间隔一秒,不介意第一次会慢一...

渐墨深的博客 6973

如何使用AutoDl平台跑自己的模型(纯干货,步骤很详细)

记录我使用AutoDL云服务器来跑自己模型的全过程

qq_45073592的博客 3万+

原创jQuery插件之loadmore

尚未开发完成,请勿使用 实验室 我是第1条数据 我是第2条数据 我是第3条数据 我是第4条数据 我是第5条数据 我是第6条数据 我是第7条数据 我是第8条

dogzhang 3601

零成本实现飞牛 OS 内网穿透:CloudFlare 隧道搭建全攻略

一、引言:突破内网限制的最优解当你的内网环境中部署了飞牛 OS 系统(无论是老旧电脑还是 NAS 设备),想要实现公网访问时,传统方案往往面临两大痛点:公网 IP 申请困难且成本高DDNS 动态解析配置复杂专业内网穿透工具存在付费门槛今天为大家带来零成本解决方案:通过免费域名搭配 CloudFlare 隧道技术,无需公网 IP 即可轻松实现飞牛 OS 服务的公网访问。全程操作可视化,新手也能快速上手!二、前期准备:必备工具清单(1)域名准备。

Honmaple的博客 7497

Codex,Copilot 是什么

GitHub Copilot是什么 **GitHub Copilot** 是一款由 **GitHub** 和 **OpenAI** 合作开发的 **AI 代码辅助工具**,它基于 **OpenAI Codex 技术**,能够根据上下文自动生成代码建议,大幅提升编程效率

ZhangJiqun&191cm&85kg 6839

VUE mint-ui mt-loadmore 上拉加载

template> div> mt-loadmore :bottom-method="loadBottom" :bottom-all-loaded="allLoaded" ref="loadmore" @bottom-status-change="handleBottomChange" :auto-fill="autoFill"> div v-for="hi

Me1ody_的博客 2511

078、镜头阴影校正:LSC算法原理与标定优化

文章摘要 镜头阴影校正(LSC)是手机影像系统中的关键技术,用于解决镜头渐晕效应导致的画面边缘暗角问题。本文详细分析了LSC算法的核心原理,包括非均匀网格划分、双线性插值等关键技术点,并揭示了标定流程中的常见陷阱(光源均匀性、灰卡反射特性、温度漂移)。文章还深入探讨了增益计算的工程实现细节,以及实际调优中的关键考量因素(色差校正、动态场景适应等)。作者结合15年经验,给出了包括验证方法、网格参数设计、产线标定等实用性建议,强调LSC算法应与光学设计协同优化,才能达到最佳效果。

sundong_81的博客 43

Sencha Touch下拉刷新、上拉自动加载

在list的config中添加插件 defaults:{ xtype : 'list', height : Public.screenHeight * .82 - 10, style:'background : transparent;border-right:#EEE 1px solid;',         itemCls : 'left-list',

Xu_Shuang的博客 741

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

带加载更过功能的LoadMoreRecyclerView

类实现 /** * * 添加加载更多功能 * Created by chs . */ public class LoadMoreRecyclerView extends RecyclerView { private boolean isScrollingToBottom = true; private FloatingActionButton floatingActio

FinyGao 5277

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

LoadMore上拉加载问题

在商品显示的时候想要使用Mint-ui的loadmore来实现上拉加载更多的效果,结果模板导入进去的时候还没有下拉就直接调用了loadBottom()函数,显示如下: 内容无法下拉。后来才发现是样式中没有给内容区域添加overflow:scoll的属性: 添加overflow属性后,显示部分可以通过滑动看到,就可以实现下拉的效果。 PS:在文字格式上加横线:text-decorat...

xyaiwh的博客 1091

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

vue自定义指令v-load-more实现上拉加载

vue通过自定义指令实现loadMore上拉加载,实现方法: common.js /** * 获取style样式 */ export const getStyle = (element, attr, NumberMode = 'int') =&gt; { let target; // scrollTop 获取方式不同,没有它不属于style,而且只有doc...

przlovecsdn的博客 1万+

load more ,滚动加载

dataAll = [] data = [] loadDataOpt = { pageNo: 0, hasMore: false, pageSize: 15, isLoading: false }; getScreenBottomLastItemData(): number { const $list = document.querySelectorAll('.item'); const $last = $list[$list.length - 1]; const toBo.

好好学习,天天向上 ~ 1107

vue基于mint-ui组件loadmore实现上拉加载更多,下拉刷新功能

这个是模拟手机写的简单样式,不要在意这些细节,为了撑满容器每次加载十二 那就开始代码了  ==》 先安装 mint-ui 在main.js中引入mint-ui的css样式和组件:  import 'mint-ui/lib/style.css' import { Loadmore } from 'mint-ui'; Vue.component(Loadmore.name, ...

奔跑的IT小白的博客 1万+

为RecyclerView添加load more功能

思路 实现LoadMore功能主要是从Adapter入手,通过在onAttachedToRecyclerView方法里给RecyclerView添加滑动监听来实现。一种思路是实现一个LoadMoreAdapter基类让其他的Adapter继承来获得load more的能力,但是这样的实现方式感觉有点侵入原有的Adapter代码,而且不够灵活,所以本文采用代理原有Adapter的方式来实现。 实现F...

a62321780的博客 4473

C++ 入门笔记(十七):list 入门 —— 为什么 list 不能 sort?

第17课:用大白话讲清 list 的双向链表结构、哨兵头、push_back 四步、迭代器封装、merge 与 splice 的区别,以及 vector 排序为什么常比 list 快。

wo_jack的博客 259

list

的底层是双向链表结构,双向链表中每个元素存储在互不相关的独立节点中,在节点中通过指针指向其前一个元素和后一个元素。,因此反向迭代器的实现可以借助正向迭代器,即:反向迭代器内部可以包含一个正向迭代器,对正向迭代器的接口进行包装即可。是可以在常数范围内在任意位置进行插入和删除的序列式容器,并且该容器可以前后双向迭代。迭代到该位置,在这段位置上迭代需要线性的时间开销;最大的缺陷是不支持任意位置的随机访问,比如:要访问。还需要一些额外的空间,以保存每个节点的相关联信息。个元素,必须从已知的位置。

xie0510_的博客 295

【C++】【STL】list_OJ题

本文系统解析了8道C++链表经典OJ题,按“算数操作”与“指针重连”分为两组,强调指针操作与数据结构解耦的重要性。通过手写ListNode、std::list及带头双向循环链表三类载体验证算法普适性,重点剖析空链、单节点、全相同值等6类边界情况,并给出统一编译与调试方案(g++11 + -Wall -O2),确保零告警、可追踪。所有题目时间复杂度均为O(N),常数差异源于遍历次数与操作开销,代码实现兼顾正确性与面试可用性。

这里是Cocatrice的博客,感谢大家一直以来的支持和鼓励,如果对C/C++方向感兴趣的话,可以通过主页的微信名片加Cocatrice的好友,也可以通过邮箱:Chen31980094@163.com 联系,一同加油! 6008

Redis 数据类型详解:Hash 哈希与 List 列表

大 key 指单个 key 对应的 value 过大(如 Hash 字段数极多、List 元素极多)。危害包括:单次全量命令(

2303_77004089的博客 126

Java 集合框架(List、Set、Map)与常用基础

本文整理Java集合框架核心知识,涵盖集合体系、Collection接口API、List(ArrayList、LinkedList、Vector)、Set(HashSet、TreeSet)、Map(HashMap、TreeMap、Hashtable)实现类原理、泛型、增强for循环、可变参数与工具类,并附核心易错点速查表。

既然你都点开这里了,那可以给我点个关注吗?可以吗?可以吗? 494

List(下):LPOP / RPOP、BLPOP / BRPOP 与 LINDEX、LINSERT

这是《Redis C++ 实战笔记》系列的第 07 篇。上一篇是往列表里放,这一篇是往外拿——包括那个会"等"的弹出。

wbs_scy的博客 127
上一篇: Sencha Touch 用scroller实现滚到底部加载更多
下一篇: List Pull Refresh Plugin for Sencha Touch
OmelasShell
博客等级 码龄15年 5粉丝 6原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值