PDA

View Full Version : Issue with grid.view.getRecords when upgrading from 4.1.1 to 4.2.1



Scott Mildenberger
20 Mar 2014, 1:43 PM
We are upgrading Extjs from 4.1.1 to 4.2.2 and the below line of code is no longer working:


var theData = customerGrid.view.getRecords(customerGrid.view.getNodes());

If I do a console.log() it shows undefined for theData. If I compare a console.log of the getNodes() and compare between the two versions the I see the following for each grid row:

4.1.1 -
tr.x-grid-row.x-grid-row-alt


4.2.2 -
tr#gridview-1020-record-ext-record-69.x-grid-row.x-grid-data-row



It looks like there is extra wrapping on 4.2.2 which is making getRecords() not work.

Anybody have any idea why or how else to read all the grid rows into an array?

Thanks,

Gary Schlosberg
22 Mar 2014, 7:54 AM
I couldn't find any existing issues regarding this issue with getRecords. Are you able to isolate the behavior in a test case?
https://fiddle.sencha.com/#home

Scott Mildenberger
24 Mar 2014, 6:46 AM
I created a test case here https://fiddle.sencha.com/#fiddle/4ff

The behavior is when the button 'Download to Excel' is clicked. If I run it under 4.1.1 both var's theData and stuff have values as I expect. If I run under 4.2.0 or 4.2.1 then I get Uncaught TypeError: Cannot call method 'get' of undefined on the call to getRecords(). I have two versions of the call and both work the same way, I came across the second version while researching this issue so tried it also.

Thanks,

Scott

Gary Schlosberg
28 Mar 2014, 3:59 PM
Clicking that button calls exportToSS(), which doesn't seem to exist.

Scott Mildenberger
30 Mar 2014, 9:02 AM
Clicking that button calls exportToSS(), which doesn't seem to exist.

That function is at the very beginning of the source in the fiddle. You won't see anything happen unless you look at the console. There are some console.log() statements and you will see the undefined error when running under 4.2.x but no error happens under 4.1.1. I stripped out the code that was sending back to the server to create the Excel file that is why the function doesn't appear to be doing anything.