View Full Version : DWRProxy,PagingGrid and pageSize problem
gounis
27 Sep 2007, 8:31 AM
Hello,
I am trying to get the code http://extjs.com/forum/showthread.php?t=5586 work with the Paging Grid. But I get an error when I try to access the last page because the records left are less than pageSize. Any ideas how can I solve this? Firebug detects the error in getJsonAccessor function in line : return obj[expr]
Thanks in advance!
devnull
27 Sep 2007, 9:20 AM
what is the error? is it coming from javascript or does it originate in your database code?
Animal
28 Sep 2007, 12:18 AM
You can't use a JsonReader with DWR.
DWR marshalls and unmarshalls the objects each side so that you get Javascript objects returned, not JSON strings which need to be decoded.
Are you returning a ListRange object from your DWR call? If you, you need a ListRangeReader.
christa
28 Sep 2007, 12:58 AM
getJsonAccessor is a function of Ext.data.ListRangeReader, we don't use JsonReader....
The error in firebug is in JavaScript and doesn't originate in the database.
The thing is that 'obj' is undefined, which is reasonable. If PageSize is 12 but the records left are 9, the error will occur when trying to display the 10th record.
Thanks
christa
28 Sep 2007, 4:47 AM
Ok, it worked!
In case anyone else needs it,
I added an if in Ext.data.ListRangeReader.read to check if the object read is null or not.
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.