PDA

View Full Version : GridSummary with DWR not working



Tod
12 Oct 2010, 2:12 PM
I am getting an error from within DWR "record.get is not a function" when I attempt to use GridSummary for a column with a mapping. My grid has a column { dataIndex: 'quantity0', summaryType: 'sum' } and the store has a JsonReader with a field { name: 'quantity0', mapping: myarray[0].quantity }. Any suggestions as to what could be wrong? I tried switching the summaryType to 'count' but it still failed. The grid is never rendered if I have the summaryType. For a column without the mapping, it seems to be working.

Thanks for any help you can provide.
-Tod

jsakalos
12 Oct 2010, 9:59 PM
DWR is not supported on this forum, just core Ext. I can move this thread to another forum if you want.

Condor
13 Oct 2010, 12:32 AM
That mapping looks wrong. Shouldn't it be a string or, if you can't put it in a string, a function?

Tod
13 Oct 2010, 4:14 AM
You are right, I simplified the mapping from what it really is, and left off the string quotes. Mapping works great as long as I don't include a summaryType my grid is fully populated...but if I include it, it fails. Please do move this to appropriate forum. Thanks.
-Tod

Condor
13 Oct 2010, 4:22 AM
Does the field have a type that supports summation? Or do you need to add something like type:'float' to the field?

Tod
13 Oct 2010, 4:25 AM
I wondered about that, but switching to summaryType: 'count' gets me the same error. I'm not clear why a DWR callback is made... wouldn't gridSummary just walk the JSON that has already been returned? -Tod

Condor
13 Oct 2010, 4:28 AM
How exactly are you filling the store with records? Are you using DWRProxy or do you have your own loading code?

Tod
13 Oct 2010, 4:36 AM
I'm using DwrProxy. The DWR error is in dwr.engine._sendData = function(batch)... and involves a remoteHandleCallback on data that looks like its from a different store. I'll try removing the other store completely and see if I can make any progress... one of those 'looks fine to me' problems no-doubt. -Tod

Tod
13 Oct 2010, 5:06 AM
I'm quite confused now. I removed the other store and got an error inside my renderer for the grid cells! It was being invoked on some sort of empty record that had store undefined and no methods (the apparent cause of the error -- the record has no get method). After removing the cell renderer I am seeing gridSummary working. In short, it appears that things are not playing well together. I added back the other store but without the cell renderer, and it also worked. So, the problem is that the renderer is invoked with bad data if and only if using gridSummary. Perhaps the cell renderer is invoked for summary data because I didn't specify a summaryRenderer...

Condor
13 Oct 2010, 5:11 AM
You've solved your own problem. If no summaryRenderer is specified, GroupSummary will use the normal column renderer, but it will call it with different (less) parameters.

Tod
13 Oct 2010, 5:17 AM
Thanks. That was the problem -- my cell renderer did not expect to get invoked for the summary cells.
-Tod