Andy Jarrett // Code. Develop. Create.

Dynamically hiding a HTML CFGridColumn

I've been working with CFGrids recently especially the HTML format. One recent issue I had was the ability to dynamically hide a column once the grid has been loaded. Luckily the Ext's framework that sits underneath is full of hidden gems in ways you can add extra functionality and ColdFusion provides ColdFusion.Grid.getGridObject that allows you to tap into this First, lets create our grid args = structNew(); args.autowidth = true; args.name = "myTestGrid"; args.format = "html"; args.width = "250"; args.query = "gridData"; The idea of the code will be to dynamically hide the first column onLoad. Complete code should look like this: args = structNew(); args.autowidth = true; args.name = "myTestGrid"; args.format = "html"; args.width = "250"; args.query = "gridData";

I’m here, learning and working away. If you liked this content and want to keep me going, consider buying me a coffee. Your support keeps this site running and the coffee brewing! ☕️