文辉居士

extjs 回车键

    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(); } }}); } } } }]}]

 

posted on 2012-08-03 15:57  restService  阅读(450)  评论(0编辑  收藏  举报

导航


我是有底线的赠送场