var storeCpye = new Ext.data.GroupingStore({
proxy : new Ext.data.HttpProxy({
url : 'cxgl_cpye.app?dateTime=' + new Date().getTime() + '&subTranCode=list'
}),
reader : new Ext.data.JsonReader({
root : 'hstamcx',
totalProperty : "results",
fields : ["zfe_hz","khbh","bankacc","fundacc","xxsdm","dxjgdm",
"cpdm","tazh","tajyzh","tadm","hybh","zfe","lsdjfe",
"cqdjfe","zhtzfe","bddjfe","fhfs","yfhfs","fhbl",
"zrzfe","fejg","khlb","zjtzbz","bqsy","sybl","mrcb",
"ljsr","wfsy","wfsydj","dtsy","glfzkl","glfje",
"dqglf","glfrq","gxrq","apex1","apex2","apex3"]
})//,
//sortInfo : {
// field : 'cpdm',
// direction : 'DESC'
//},
//groupField : 'cpdm'
}); var colMArray = new Array();
colMArray = [{header : "产品代码", dataIndex : "cpdm", width : 100},
{header : "代销机构代码", dataIndex : "dxjgdm", width : 100},
//{header : "总份额汇总", dataIndex : "zfe_hz", width : 100},
{header : "总份额", dataIndex : "zfe", width : 100, align:"right"},
{header : "客户编号", dataIndex : "khbh", width : 100},
{header : "理财账号", dataIndex : "bankacc", width : 100},
{header : "客户资金账号", dataIndex : "fundacc", width : 100},
{header : "本行销售商代码", dataIndex : "xxsdm", width : 100},
{header : "TA账号", dataIndex : "tazh", width : 100},
{header : "TA交易账号", dataIndex : "tajyzh", width : 100},
{header : "TA代码", dataIndex : "tadm", width : 100},
{header : "合约编号", dataIndex : "hybh", width : 100},
{header : "临时冻结份额", dataIndex : "lsdjfe", width : 100, align:"right"},
{header : "长期冻结份额", dataIndex : "cqdjfe", width : 100, align:"right"},
{header : "组合投资份额", dataIndex : "zhtzfe", width : 100, align:"right"},
{header : "本地冻结份额", dataIndex : "bddjfe", width : 100, align:"right"},
{header : "当前分红方式", dataIndex : "fhfs", width : 100},
{header : "原分红方式", dataIndex : "yfhfs", width : 100},
{header : "红利比例(%)", dataIndex : "fhbl", width : 100},
{header : "昨日总份额", dataIndex : "zrzfe", width : 100, align:"right"},
{header : "份额所属机构", dataIndex : "fejg", width : 100},
{header : "客户类别", dataIndex : "khlb", width : 100},
{header : "追加投资标志", dataIndex : "zjtzbz", width : 100},
{header : "本期收益", dataIndex : "bqsy", width : 100, align:"right"},
{header : "收益客户比例(%)", dataIndex : "sybl", width : 100},
{header : "买入成本", dataIndex : "mrcb", width : 100, align:"right"},
{header : "累计收入", dataIndex : "ljsr", width : 100, align:"right"},
{header : "未付收益", dataIndex : "wfsy", width : 100, align:"right"},
{header : "冻结的未付收益", dataIndex : "wfsydj", width : 100, align:"right"},
{header : "当天新分配收益", dataIndex : "dtsy", width : 100, align:"right"},
{header : "管理费折扣率(%)", dataIndex : "glfzkl", width : 100},
{header : "管理费总额", dataIndex : "glfje", width : 100, align:"right"},
{header : "当前管理费", dataIndex : "dqglf", width : 100, align:"right"},
{header : "管理费计算日期", dataIndex : "glfrq", width : 100},
{header : "更新日期", dataIndex : "gxrq", width : 100}]; var colQd = new Ext.grid.ColumnModel(colMArray); // GRID定义
var gridCpye = new Ext.grid.GridPanel({
id : 'cpye_grid',
title:'[产品余额]查询',
height : 800,
stripeRows : true,
bodyStyle : 'width:100%',
disableSelection : true,
cm : colQd,
viewConfig : {
forceFit : false
},
store : storeCpye,
iconCls : 'details',
animCollapse : true,
trackMouseOver : false,
loadMask : {
msg : '正在加载[产品余额]信息,请稍侯……'
},
//selModel : smQd,
selModel : new Ext.grid.RowSelectionModel({singleSelect:true}),
tbar : ['-',new Ext.form.Label({
text : '产品代码:'
}),new Ext.form.TextField({
id : 'cpdm',
name : 'cpdm',
width : 130
}),'-',new Ext.form.Label({
text : '代销机构代码:'
}), new Ext.form.TextField({
id : 'dxjgdm',
name : 'dxjgdm',
width : 130
}), '-', {
pressed : true,
text : '  查    询    ',
iconCls : 'yes',
handler : selinfo
},'-',new Ext.Toolbar.Fill(),'-',new Ext.form.Label({
text : ' 查询方式: '
}),new Ext.form.Radio({
id:"cpdm_radio",
name : "select_method",
inputValue : "cpdm desc,dxjgdm desc",
checked : true,
boxLabel : " 产 品  "//,
//listeners : {
//check : radiochange
//} }),
new Ext.form.Radio({
id:"dxjgdm_radio",
name : "select_method",
inputValue : "dxjgdm desc,cpdm desc",
boxLabel : "代销机构  "//,
//listeners : {
//check : radiochange
//}
}),'-'
],
bbar : new Ext.PagingToolbar({
pageSize : 20,
store : storeCpye,
displayInfo : true,
emptyMsg : '没有记录'
})
});
    private void list() throws HsException {
String cpdm = $("cpdm_sel");
String dxjgdm = $("dxjgdm_sel");
String order_by = $("select_method_sel");
String start = $("start");
String limit = $("limit");
int b=0,m=20;
if(start!=null && !start.equals("")){
b = new Integer(start);
}
if(limit!=null && !limit.equals("")){
m = new Integer(limit);
}
//查询
CpyeDao cpyeDao = new CpyeDao(request, response);
String sql = cpyeDao.select(cpdm,dxjgdm,order_by);
List<HashMap> list1 = null;
try {
list1 = this.findSql(new String(sql.getBytes("iso8859-1"),"UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} List<HashMap> list = new ArrayList();
for(int i = b; i < b + m && i<list1.size(); i++ ){
list.add(list1.get(i));
} //把list转化成Json
// StringBuffer s = new StringBuffer("{results:"+list1.size()+",result:[");
// for( int i=0;i< list.size();i++){
// HashMap hm = list.get(i);
//
// for(int j=0;j < columns.length; j++){
// if(j==0) s.append("{");
// s.append(columns[j]+":\""+hm.get(columns[j].toUpperCase().toString()).toString()+"\"");
// if(j>0 && j<(columns.length-1) ) s.append(",");
// if(j==(columns.length-1)) s.append("}");
// }
// }
// s.append("]}"); // AjaxTools.exAjax("{results:"+list1.size()+",hstamcx:"+JsonTools.agentJdbcLstToJson(list,lpDict,gbismDict)+",\""+paramName+"\":\""+paramValue+"\"}",response);
AjaxTools.exAjax("{results:"+list1.size()+",hstamcx:"+JsonTools.agentJdbcLstToJson(list,lpDict,gbismDict)+"}",response);
}
public class AjaxTools {
public static void exAjax(String ajaxString,HttpServletResponse response)throws HsException{
PrintWriter out = null;
try{
response.setContentType("text/html;charset=utf-8");
response.setHeader("Cache-Control", "no-cache");
out=response.getWriter();
out.write(ajaxString);
out.flush();
}catch(Exception e){
throw new HsException(HsErrorMsg.ERR_DEFAULT, "AJAX通讯出错!"+e.getMessage());
}
finally{
out.close();
}
} }

Extjs Ajax 分页的更多相关文章

  1. [jQuery]jQuery DataTables插件自定义Ajax分页实现

    前言 昨天在博客园的博问上帮一位园友解决了一个问题,我觉得有必要记录一下,万一有人也遇上了呢. 问题描述 园友是做前端的,产品经理要求他使用jQuery DataTables插件显示一个列表,要实现分 ...

  2. ThinkPHP 整合Bootstrap Ajax分页

    ThinkPHP Ajax分页代码 publicfunction index() { $where=array(); $name = I('name'); if(!empty($name)){ $wh ...

  3. yii2的分页和ajax分页

    要想使用Yii分页类第一步:在控制器层加载分页类 use yii\data\Pagination;第二步: 使用model层查询数据,并用分分页,限制每页的显示条数$data = User::find ...

  4. [js开源组件开发]ajax分页组件

    ajax分页组件 我以平均每一周出一个开源的js组件为目标行动着,虽然每个组件并不是很庞大,它只完成某一个较小部分的工作,但相信,只要有付出,总会得到回报的.这个组件主要完成分页的工作. 这张图里显示 ...

  5. MvcPager 概述 MvcPager 分页示例 — 标准Ajax分页 对SEO进行优化的ajax分页 (支持asp.net mvc)

    该示例演示如何使用MvcPager最基本的Ajax分页模式. 使用AjaxHelper的Pager扩展方法来实现Ajax分页,使用Ajax分页模式时,必须至少指定MvcAjaxOptions的Upda ...

  6. MVC - 11(下)jquery.tmpl.js +ajax分页

    继续 mvc-11(上).dto:http://www.cnblogs.com/tangge/p/3840060.html jquery.tmpl.js 下载:http://pan.baidu.com ...

  7. laraver ajax分页

    ,设置分页容器参考laraver手册 我的设置代码如下: ,控制器调用的方法:代码如下 );         include($path);         $content = ob_get_cle ...

  8. PHP+jQuery 长文章分页类 ( 支持 url / ajax 分页方式 )

    /* ******* 环境:Apache2.2.8 ( 2.2.17 ) + PHP5.2.6 ( 5.3.3 ) + MySQL5.0.51b ( 5.5.8 ) + jQuery-1.8 **** ...

  9. PHP+jQuery 列表分页类 ( 支持 url 分页 / ajax 分页 )

    /* ******* 环境:Apache2.2.8 ( 2.2.17 ) + PHP5.2.6 ( 5.3.3 ) + MySQL5.0.51b ( 5.5.8 ) + jQuery-1.8.3.mi ...

随机推荐

  1. LeetCode403. Frog Jump

    A frog is crossing a river. The river is divided into x units and at each unit there may or may not ...

  2. Linux基础入门学习笔记之二

    第三节 用户及文件权限管理 Linux用户管理 Linux是可以实现多用户登录的操作系统 查看用户 who命令用于查看用户 shiyanlou是当前登录用户的用户名 pts/0中pts表示伪终端,后面 ...

  3. dp入门题目

    本文文旨,如题... 转载请注明出处... HDOJ 1176 免费馅饼 http://acm.hdu.edu.cn/showproblem.php?pid=1176 类似数塔,从底往上推,每次都是从 ...

  4. 实战MEF(1)一种不错的扩展方式

    在过去,我们完成一套应用程序后,如果后面对其功能进行了扩展或修整,往往需要重新编译代码生成新的应用程序,然后再覆盖原来的程序.这样的扩展方式对于较小的或者不经常扩展和更新的应用程序来说是可以接受的,而 ...

  5. 更改MyEclipse中的src目录的浏览方式

    看到这个标题,有人可能不会明白,这里先看张图: 右边的图就是我们要更改的样子,有的时候我们做项目需要看下目录的层次,于是使用了Navigator的那个视图,其实常用的这种包视图也可以变成那种样式. 这 ...

  6. linux服务开机启动

    1.chkconfig 配置开机启动 在  /etc/init.d  创建执行服务的可执行脚本,赋予脚本可执行权限.如果是通过yum 或者rpm安装的,并且已经在该目录下存在对应的启动脚本,就不用自己 ...

  7. C#.net实现图片上传功能

    C#.NET前台:<asp:Image ID="imgFood" runat="server" /> <asp:FileUpload ID=& ...

  8. linux config

    1.自定义命令:.bashrc 文件添加自定义命令 2.完成后,命令:source . .bashrc  使配置的自定义命令生效,如果提示没有该命令的情况,用   . .bashrc (注意是2个“点 ...

  9. ajax异步请求模式

    什么是异步请求 我们知道,在同步请求模型中,浏览器是直接向服务器发送请求,并直接接收.处理服务器响应的数据的.这就导致了浏览器发送完一个请求后,就只能干等着服务器那边处理请求,响应请求,在这期间其它事 ...

  10. Python面向对象中super用法与MRO机制

    1. 引言 最近在研究django rest_framework的源码,老是遇到super,搞得一团蒙,多番查看各路大神博客,总算明白了一点,今天做一点总结. 2. 为什么要用super 1)让代码维 ...