extjs 回车键

本文介绍了一个使用ExtJS框架实现的人员统计模块中的搜索功能。具体包括了如何通过监听键盘事件来触发搜索行为,以及如何根据不同条件加载数据到网格组件(personnelStatGrid)中,并对数据进行更新显示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

    dockedItems:[{
        xtype:'toolbar',
        items:[{ xtype:'textfield', id:'processUser', name:'processUser', labelWidth:50, fieldLabel:'理货员', enableKeyEvents:true, listeners:{ keyup:function (value, e, eOpts) { page_param={processUser:"",start:0,limit: 20}; if (e.getKey() == e.ENTER && this.getValue().length > 0) { page_param={processUser:value.getValue(),start:0,limit: 20}; Ext.getCmp("personnelStatGrid").getStore().load({params:{processUser:value.getValue()}}); }else if(e.getKey() == e.ENTER && this.getValue().length == 0){ Ext.getCmp("personnelStatGrid").getStore().load({callback:function(r, options, success){ if (success) { var currentpage = Ext.getCmp("personnelStatPagingToolbar").store.currentPage; var totalpage = Ext.getCmp("personnelStatPagingToolbar").store.totalCount / Ext.getCmp("personnelStatPagingToolbar").store.pageSize + 1; if (currentpage > totalpage ){ Ext.getCmp("personnelStatPagingToolbar").moveFirst(); } }else{ Ext.getCmp('personnelStatGrid').store.removeAll(); } }}); } } } }]}]

 

转载于:https://www.cnblogs.com/zengsong-restService/archive/2012/08/03/2621796.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值