August 6, 2014
Workaround for ajax cfgrid bug in CF11 in which ajaxonload() is not working properly
Comments
(3)
August 6, 2014
Workaround for ajax cfgrid bug in CF11 in which ajaxonload() is not working properly
Newbie 12 posts
Followers: 0 people
(3)

In coldfusion 11 release there is an open bug in which if you try to use any ColdFusion.grid related function in a function that is called by ajaxOnLoad, the grid object will not be available. 

A grid will load properly, but when the javascript function is called with AjaxOnLoad and  function tries to reference the grid, you will get that the reference is “undefined”.

This is a sample code :

<html> 

   <head> 

      <title>AjaxOnLoad test</title> 

        <script> 

            init = function() 

            { 

                ColdFusion.Grid.sort(‘datagrid’, ‘col_one’, ‘ASC’);

            } 

        </script> 

    </head> 

 <body> 

        <cfform name=’formOne’>

            <cfgrid name=’datagrid’ format=”html” textcolor=”blue”>

                <cfgridcolumn name=’col_one’>

                <cfgridrow data=”data1″>

                <cfgridrow data=”data2″>

                <cfgridrow data=”data3″>

            </cfgrid>

        </cfform>

        <cfset AjaxOnLoad(“init”)> 

    </body> 

</html>

The above code will break at “ColdFusion.Grid.sort(‘datagrid’, ‘col_one’, ‘ASC’);” as grid object will not be available at that moment.

 

Workaround :

The current workaround for this issue is to wrap the references to the grid objects within Ext.onReady method, like this:

   init = function() 

            {

   Ext.onReady(function ()

                {

                                 ColdFusion.Grid.sort(‘datagrid’, ‘col_one’, ‘ASC’);

});

            } 

 

Note: Fix for this bug will be available in next update

3 Comments
2014-09-02 11:43:10
2014-09-02 11:43:10

This issue also exist in cflayout type=”tab”. Generally speaking anywhere you are using ajaxOnload()

Like
2014-08-06 14:49:33
2014-08-06 14:49:33

I hope that update is also resolving the extremely long app initialization times. 8-11 secs to initialize an app is absurd. At that point either the page is timing out or the user has already given up and left.

If the general attitude is well it only needs to happen once over 15 minutes, its invalid. I can name off countless scenarios. Where a revenue driving application suffers severely under this current wait time. It needs to be fixed ASAP.

Like
2014-08-06 06:19:33
2014-08-06 06:19:33

any idea when that update will be?

Like
Add Comment