Entries Tagged as 'ajax'

Coldfusion 11 update 3 fixed the cfgrid javascript binding issue.(bug number 3712909,3712885)

Prior to this, js binding was broken where as CFC binding as well as URL binding were wroking properly.

As a result pagination, dynamic binding etc were not working if js binding was used though basic static grid was working properly.

Even query columns were not getting mapped to their associated grid columns.

This had happened due to our internal upgrade of EXTJS framework which did not support js binding.

So we had to write a custom js binding wrapper to make it work in coldfusion. Now everything works fine in JS binding

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