extjs 分頁(yè)使用jsp傳遞數(shù)據(jù)示例
Ext.onReady(function() {
store3 = new Ext.data.JsonStore({
autoDestroy: true,
totalProperty : 'totle',
url: 'service.do',
storeId: 'myStore',
root: 'data',
fields : [ 'id', "name", "pw" ]
});
var pagingToolbar = new Ext.PagingToolbar({
emptyMsg : "沒(méi)有數(shù)據(jù)",
displayInfo : true,
displayMsg : "顯示從{0}條數(shù)據(jù)到{1}條數(shù)據(jù),共{2}條數(shù)據(jù)",
store : store3,
pageSize : 50
});
var grade = new Ext.grid.GridPanel({
title : "數(shù)據(jù)列表",
store : store3,
height : 300,
bbar : pagingToolbar,
columns : [ {
header : "id",
dataIndex : "id",
width : 300
}, {
header : "name",
dataIndex : "name",
width : 300
}, {
header : "pw",
dataIndex : "pw"
} ],
region : 'center'
});
var panel = new Ext.Viewport({
layout : 'border',
items : [ grade ]
});
});
action********************
protected void service(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
List list = new ArrayList();
for (int i = 0; i < 50; i++) {
Person p = new Person();
p.setId("id" + i);
p.setName("name" + i);
p.setPw("pw" + i);
list.add(p);
}
StringBuffer info = new StringBuffer();
info.append("{totle:2000,data:");
info.append(JSONArray.fromObject(list));
info.append("}");
System.out.println(info.toString());
System.out.println("*****doPos");
request.setAttribute("info", info.toString());
request.getRequestDispatcher("/info.jsp").forward(request, response);
}
info.jsp************注意:jsp除了 @page 不能有其他的文字
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
${info}
web.xml***************
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <servlet> <servlet-name>test</servlet-name> <servlet-class>com.aa.TestAction</servlet-class> </servlet> <servlet-mapping> <servlet-name>test</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
- js分頁(yè)工具實(shí)例
- jsp分頁(yè)顯示完整實(shí)例
- js分頁(yè)代碼分享
- js對(duì)文章內(nèi)容進(jìn)行分頁(yè)示例代碼
- js控制分頁(yè)打印、打印分頁(yè)示例
- js+css實(shí)現(xiàn)的簡(jiǎn)單易用兼容好的分頁(yè)
- js寫(xiě)的評(píng)論分頁(yè)(還不錯(cuò))
- JS實(shí)現(xiàn)動(dòng)態(tài)移動(dòng)層及拖動(dòng)浮層關(guān)閉的方法
- js用拖動(dòng)滑塊來(lái)控制圖片大小的方法
- JS+CSS實(shí)現(xiàn)的拖動(dòng)分頁(yè)效果實(shí)例
相關(guān)文章
extjs 分頁(yè)使用jsp傳遞數(shù)據(jù)示例
extjs實(shí)現(xiàn)的分頁(yè),使用jsp傳遞數(shù)據(jù),具體實(shí)現(xiàn)過(guò)程如下,需要的朋友莫錯(cuò)過(guò)2014-07-07
Ext JS 4實(shí)現(xiàn)帶week(星期)的日期選擇控件(實(shí)戰(zhàn)一)
有一些日期選擇的需求是要看到星期,就是日期中的哪一天是這一年的第幾周,遺憾的是Ext js 并沒(méi)有提供這樣的配置,下面為大家分享下理想的解決方法2013-08-08
Extjs 4.x 得到form CheckBox 復(fù)選框的值
CheckBox(復(fù)選框)主要用來(lái)接收用戶(hù)選擇的選項(xiàng),那么如何通過(guò)Extjs 4.x 得到form CheckBox的值呢?下面有個(gè)不錯(cuò)的方法,大家值得一看2014-05-05
Extjs ajax同步請(qǐng)求時(shí)post方式參數(shù)發(fā)送方式
一般參數(shù)傳遞通過(guò)url后面跟后臺(tái)也能取到,不過(guò)看到send參數(shù)也可以發(fā)送參數(shù),試驗(yàn)了一下服務(wù)器端接受不到發(fā)送的參數(shù),在firebug里看到發(fā)送的請(qǐng)求post部分是一個(gè)串,不太象正常發(fā)送的參數(shù)。2009-08-08
ExtJS Store的數(shù)據(jù)訪(fǎng)問(wèn)與更新問(wèn)題
ExtJS Store的數(shù)據(jù)訪(fǎng)問(wèn)與更新問(wèn)題,需要的朋友可以參考下。2010-04-04
extjs ColumnChart設(shè)置不同的顏色實(shí)現(xiàn)代碼
extjs為ColumnChart設(shè)置不同的顏色想必有很多朋友還是比較陌生的吧,接下來(lái)為大家詳細(xì)介紹下具體設(shè)置代碼,感興趣的朋友可以參考下哈2013-05-05
ExtJS4中使用mixins實(shí)現(xiàn)多繼承示例
在ExtJS4中使用mixins來(lái)實(shí)現(xiàn)多繼承,下面有個(gè)不錯(cuò)的示例,感興趣的朋友可以參考下2013-12-12
入門(mén)基礎(chǔ)學(xué)習(xí) ExtJS筆記(一)
這段時(shí)間手中項(xiàng)目已經(jīng)完成,空閑時(shí)間較多。開(kāi)始了學(xué)習(xí)ExtJs之旅。2010-11-11
Extjs 繼承Ext.data.Store不起作用原因分析及解決
有關(guān)Extjs 繼承Ext.data.Store 不起作用的原因有很多種,接下來(lái)與大家分享下,本人遇到的,這個(gè)Store寫(xiě)出來(lái)之后 是不會(huì)起到作用的,感興趣的朋友可以看下詳細(xì)的原因及解決方法2013-04-04

