In CF9 i have a cfgrid bound to a hidden field and a cfc query component.
Then i have a select box where the onChange() event triggers a js function which updates the hidden field with the select value and triggers the cfc, populating the grid with new data.
In this js function, i'm trying to add an event that would trigger a chunk of code when the grid is refreshed, like:
function myFunc(val) {
document.getElementById('myHiddenField').value=val;
ColdFusion.Grid.refresh('myGrid',true);
var grid = ColdFusion.Grid.getGridObject('myGrid');
grid.addEvents('reconfigure');
grid.on('reconfigure',function(){
alert("Grid changed!");
});
}
I don't get an error but the function never executes, don't get the alert. If i change the event to something that happens AFTER the grid gets refreshed, like grid.addEvents('click') it works fine. What am I missing?
Thanks