chuang_chuang
chuang_chuang
2011-08-05 09:07

关于extjs中gridPanel分页问题,急求解答

  • ext
  • javascript

最近写了一个小项目可在分页的时候遇到了一个问题,请大侠们帮忙,就是在分页时请求数据,为何发出两次请求,第一次失败,而第二次则没有传递数据。
一下代码为JS创建Store数据
var bookStore = new Ext.data.Store({
autoLoad :true,
reader: new Ext.data.XmlReader({
totalRecords: "results",
record: "Book",
id: "id",

        },
        Ext.data.Record.create([
            {name: 'id'},
            {name: 'bookName'},
            {name: 'author'},
            {name: 'typeName'},
            {name: 'price'},
            {name: 'brief'},
            {name: 'publishTime'}
        ])
        ),
        proxy : new Ext.data.HttpProxy({
            url : 'book.do?method=getBookList'          })

    })

    bookStore.load({params:{start:0,limit:5}});

以下是action的方法
public ActionForward getBookList(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
String satrtString = request.getParameter("start");

String limitString = request.getParameter("limit");
s = "0";
mString = "3";
System.out.println("EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"+satrtString);
System.out.println("EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"+limitString);
List books = service.getBooks(satrtString,limitString);
String xml = ExtHelper.getXmlFromList(books);
response.setContentType("application/xml;charset=UTF-8");
response.getWriter().write(xml);
return null;
}
在连接数据上没有问题,
以下是通过firefox的firbug调试显示的请求
第一次请求失败

POST http://localhost:8080/EXTJS_bookManage_page/book.do?method=getBookList

Aborted

参数头信息Post响应
参数application/x-www-form-urlencoded
limit 5
start 0
源代码
start=0&limit=5
第二次请求成功,但是没有传递数据
GET http://localhost:8080/EXTJS_bookManage_page/book.do?method=getBookList&_dc=1312505659541

200 OK
824ms

参数头信息响应XML

<?xml version="1.0" encoding="utf-8"?>


0

请问那个大侠能够帮忙解决一下啊

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答

为你推荐