888-898-3404

ROK Blog

Dojo and Coldfusion - A Fix for Using the Dojo TitlePane with CFGrid

Jason Harris - Tuesday, July 28, 2009

We are automatically updating a coldfusion grid with results from a database as users type in a search box. This grid is contained in a dojo dijit.TitlePane. The TitlePane is a collapsible window.

Recently, we discovered an issue in IE. If the Cfgrid has results, then you collapse and open the dojo TitlePane, the grid will disappear. Here is how we fixed it:

Step 1: Set the duration in the TitlePane to 0
Code:div dojoType="dijit.TitlePane" id="resultsDivholder" duration="0"

Step 2: Attach an event to the toggle function using dojo.connect
Code: dojo.connect(dijit.byId('resultsDivholder'),"toggle",gridToggle);
Note: The TitlePane is a dijit. Therefore, you must use dijit.byId and not dojo.byId

Step 3: Refresh the coldfusion grid when the title pane is toggled to open
Code:
function gridToggle() { if(dijit.byId('resultsDivholder').open == true) { ColdFusion.Grid.refresh('ResultsGrid'); } }


Jason Harris

Recent Posts


Tags


Archive

All content © ROK / Website by Hazel Digital Media