Yesterday, Mischa posted the following comment on my post on CF8 Ajax Grid: Renderers and Events:

Hi Steve, thank you for this example and your explanation! Do I understand correctly that init will fire once? Is there a way to fire init or any other function when the user pages through the grid using the page forward button? Thanks! Mischa.

Great question! Yes, to my knowledge the init() method is only called once. And, chances are, you really want it to only be called once. However, when the grid is initialized, and on every paging request, the data store runs it's load() method. The data store object, one of the underlying ExtJS pieces of the data grid, has a publicly available event that you can listen for, 'load'. I would go something like this.

view plain print about
1reportGrid = function(){
2    grid = ColdFusion.Grid.getGridObject('reportsGrid');
3    cm = grid.getColumnModel();
4    ds = grid.getDataSource();
5    cm.setRenderer(2,redBold);
6
7     var gridHead = grid.getView().getHeaderPanel(true);
8 var tb = new Ext.Toolbar(gridHead, [{
9 text: 'Add Art',
10 handler : showRecWin
11 }]);
12
13    grid.reconfigure(ds,cm);
14
15    ds.on('load',function(){alert('it just loaded the Data Store')});
16}

It's that last line that's the kicker. What I've done here is used the data store's on() method to assign an Event Listener to the 'load' event, with my own custom function. This will now kick off with whenever the data store calls the load() method, which happens on initialization, as well as each paging request (forwards or backwards).

There is a wealth of available knowledge, for interacting with these components, that is available in the ExtJS 1.1 API documentation. Looking at their online examples gives you an idea of how these components are built and interact, and knowing that can point you to the API documentation that will help you get the job done.