paging grid problem - Ext JS

本文探讨了ExtJS网格分页功能无法正常工作的问题。通过分析服务器响应和Firebug网络跟踪,指出了缺少总行数属性及不当的参数传递导致分页功能失效的原因。

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

why is my paging not working:?

http:/www.trendon.nl:9999/origo-dev/index.php

click on 'struct'

thnx,

Seldon
Reply With Quote
  #2  
Old 03-05-2007, 03:56 PM
Default

I have not done any active Ext development yet but a Firebug net trace of your application is interesting. A click on the struct tree node generates two identical .php requests:

http://www.trendon.nl:9999/origo-dev...blename=struct

The first get returns column info for the grid but the second indicates a routine logic bug in your php code.

Notice:  Undefined variable: orderby in C:\Server\Sites\Trendon\origo-dev\objs\Table.php
on line 29

Warning:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in 
:\Server\Sites\Trendon\origo-dev\objs\Table.php on line 61

<?xml version="1.0"?>

<totalCount>169</totalCount>
Reply With Quote
  #3  
Old 03-06-2007, 03:10 AM
Default

This has been fixed, but problem still remains. No paging!
Reply With Quote
  #4  
Old 03-06-2007, 03:48 AM
Default

I get this looking at Firebug's Net tab when the request is sent for http://www.trendon.nl:9999/origo-dev...lename=struct:

Edit: I think our cache is getting in the way!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The requested URL could not be retrieved</TITLE>
<STYLE type="text/css"></STYLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The requested URL could not be retrieved</H2>
<HR noshade size="1px">



While trying to process the request:
<PRE>
POST /origo-dev/index.php?action=loadTable&amp;tablename=struct HTTP/1.1
Host: www.trendon.nl:9999
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en,fr;q=0.8,de;q=0.5,en-us;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: UTF-8,*
Keep-Alive: 300
Proxy-Connection: keep-alive
Referer: http://www.trendon.nl:9999/origo-dev/index.php
Cookie: PHPSESSID=lkg7utudto2ded1t5e7rcvg0m1
Pragma: no-cache
Cache-Control: no-cache

</PRE>



The following error was encountered:
<UL>
<LI>

Invalid Request
[/list]



Some aspect of the HTTP Request is invalid.  Possible problems:
<UL>
<LI>Missing or unknown request method
<LI>Missing URL
<LI>Missing HTTP Identifier (HTTP/1.0)
<LI>Request is too large
<LI>Content-Length missing for POST or PUT requests
<LI>Illegal character in hostname; underscores are not allowed[/list]

Your cache administrator is . 

<BR clear="all">
<HR noshade size="1px">
<ADDRESS>
Generated Tue, 06 Mar 2007 09:53:00 GMT by www-cache (squid/2.5.STABLE14)
</ADDRESS>
</BODY></HTML>
Reply With Quote
  #5  
Old 03-06-2007, 03:58 AM
Default

A firebug trace of your public site this morning, following a cache clear, shows the same problematic URL trace and server-side error report in the page response.

Last night I should have mentioned that the paging URLs seem malformed.

If you use firebug to profile the http traffic in Jack's grid paging & remote dataset example at http://www.yui-ext.com/deploy/ext-1.0-alpha2/docs, you will find that the initial and first page forward grid population requests contain paging params, note the start and limit params. I cannot see the equivalent in your test site.

http://www.yui-ext.com/forum2/topics-remote.php?start=0&limit=25&forumId=4&sort=lastPost&dir=DESC&_dc=1173173827938&callback=stcCallback1001

http://www.yui-ext.com/forum2/topics...tcCallback1002
Reply With Quote
  #6  
Old 03-06-2007, 04:23 AM
Default

I still dont see what you mean: my initial page request contains as post vars the limit, start, sort and dir vars. For next page requests i dont know what they contain since thats my whole problem: the grid has only one page, although there should be multiple pages.
Reply With Quote
  #7  
Old 03-06-2007, 04:30 AM
Default

The reply has to contain a property specifying the total number of rows in the dataset.

The name of this property is communicated to the Reader in the "totalProperty" property of the Reader's config.
Reply With Quote
  #8  
Old 03-06-2007, 05:22 AM
Default

yes i know and i have that but its not working
Reply With Quote
  #9  
Old 03-06-2007, 05:29 AM
Default

The request: http://www.trendon.nl:9999/origo-dev...blename=struct

Does not specify "start" and "limit" params. Params sent are:

action: loadTable
tablename: struct

The response

{"cm" : [{header: "Id", width: 180, dataIndex:"struct_id"},{header: "Tabel naam", width: 180, dataIndex:"struct_tablename"},{header: "Veld naam", width: 180, dataIndex:"struct_name"},{header: "Veld type", width: 180, dataIndex:"struct_type"},{header: "Volgorde edit velden", width: 180, dataIndex:"struct_editorder"}],"mappings" : [{name: "struct_id", mapping: "struct_id", type: "string"},{name: "struct_tablename", mapping: "struct_tablename", type: "string"},{name: "struct_name", mapping: "struct_name", type: "string"},{name: "struct_type", mapping: "struct_type", type: "string"},{name: "struct_editorder", mapping: "struct_editorder", type: "string"}],"sortCol":"struct_id","sortDir":"desc", "tablename":"struct", "title":"Struct"}
Does not contain a total row count property.
Reply With Quote
  #10  
Old 03-06-2007, 05:31 AM
Default

Is your toolbar bound before data is loaded?
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值