In a previous entry I demonstrated how you can use the underlying Ext framework to enhance your CFWindow. And then Matt left a comment asking if it was possible to dynamically resize the CFWindow. The answer is yes and it's quite easy actually. The CFWindow utilizes the Ext.BasicDialog object which has a function called setContentSize, which resizes the dialog to fit the specified content size.
A couple weeks ago I posted an entry on how to save the state of selected CFLayout generated tabs on a page. Then it was asked how that example could be expanded to save the state of multiple tab layouts on a page. I have created an example of how to do that below.
Yesterday I blogged about how to create a custom date renderer for CFGrid. Today I am going to add to that example how to validate the data entered into the CFGrid before it is sent to the cfc to update the database. The CFGrid (Ext.grid.EditorGrid) object has an event called "validateedit", which fires after a cell is edited, but before the value is set in the record. We will be adding a listener to that event that will validate the data that is being submitted and, if the data is not valid, display an alert message and cancel the changes.
One of the coolest things about the ColdFusion 8 implementation of the CFGrid tag is that you can do a lot of customization, if you know your way around the Ext objects. I have found several blog entries about using custom renderers with the CFGrid tag. However, could not find a working example of one for date fields, so I decided to build one.
So I was using the cflayout tag to create a tab navigation system for reporting module. Each tab had a different report based on live data. The problem is that if you are on any tab that is not the default tab and you click refresh or press the F5 key to reload the data, then you get sent back to the default tab.
I needed to find a way to make it so that whenever a user clicked on a tab, their selected tab was saved in the session scope so that if they happen to use their browsers refresh links instead of using the refresh links I provided for them, they didn't loose which tab they were on.
If you enable the ajax debugging and browse to your page with "cfdebug" as a url parameter, then you can use the ColdFusion.Log.dump() function to dump the object you are working with into the cfdebug log window. Of course, it still has the same problem with recursion on large objects