tracker issue : CF-3792163

select a category, or use search below
(searches all categories and all time range)

CFGRID getGridObject no longer defined

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NotABug

Reporter/Name(from Bugbase): DONALD BAERT / DONALD BAERT (Donald Baert)

Created: 07/21/2014

Components: AJAX, UI Components

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Win 2012 Server x64

Vote Count: 0

Problem Description:
Many of the pages we developed using CFGRID no longer work the way they did in CF9/CF10.  We cannot call the ColdFusion.Grid.getGridObject in CF11.  It will always error with "Unable to get property 'getColumnModel' of undefined or null reference.

Steps to Reproduce:
Create a CFGRID, include code similar to:
myGrid = ColdFusion.Grid.getGridObject('gridName');
cm = myGrid.getColumnModel();

Actual Result:
 "Unable to get property 'getColumnModel' of undefined or null reference
Expected Result:
Reformat the 0 column based on the steps in the function called.
Any Workarounds:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3792163

External Customer Info:
External Company:  
External Customer Name: Donald Baert
External Customer Email:  
External Test Config: Server 2008, IIS 7.5, JRE 1.7.0_55, ColdFusion version, SQL Server 2012.  Errors on both Internet Explorer 10 and Chrome 36.



Hi Donald, Can you please check if the workaround mentioned at works for you. It basically involves wrapping around your grid references within Ext.onReady method. Thanks.
Comment by Piyush K.
11565 | August 14, 2014 08:40:49 AM GMT
I tried the workaround referenced in, but I still get the getColumnModel error referenced above. Looking at the Ext JS documentation I noticed that columnModel which was part of Ext JS 3.x is not part of Ext JS 4.x.
Comment by External U.
11566 | August 14, 2014 10:20:19 AM GMT
Hi Piyush, Here is a repro case, using code from the description. Error "myGrid.getColumnModel is not a function" is thrown. (on CF11 Update 3 (11,0,03,292024(PreRelease)) <html> <head> <title>Untitled Document</title> <script type="text/javascript"> init = function() { Ext.onReady(function(){ //ColdFusion.Grid.sort('myGrid', 'myColumn', 'DESC'); var myGrid = ColdFusion.Grid.getGridObject('myGrid') var cm = myGrid.getColumnModel(); }); } </script> </head> <body> <cfform> <cfgrid name="myGrid" format="html"> <cfgridcolumn name="myColumn" /> <cfgridrow data="1" /> <cfgridrow data="2" /> <cfgridrow data="3" /> </cfgrid> </cfform> <cfset ajaxOnLoad("init")> </body> </html> Use of getColumnModel() is/was common, and that code will break when upgrading to CF11. Thanks!, -Aaron
Comment by External U.
11567 | November 16, 2014 03:50:47 AM GMT
You are directly using EXTJS's functions. getColumnModel() does not exist in EXTJS 4. Plz refer their documentation for the latest API. Something like this : var columns = this.grid.getView().getHeaderCt().getGridColumns(); That will return an array of all the columns in the grid. Y // this will give column length columns.length; // this will give each column var c = columns[i];
Comment by Uday O.
11568 | November 24, 2014 04:49:01 AM GMT
Hello, The workaround ( did not work. This is not listed in the update 4 fixed bug list either. Is there a plan for Adobe to fix this bug or to document a solution? I will continue to look for a solution with the API for EXT JS 4.
Comment by External U.
11569 | February 11, 2015 04:14:21 PM GMT