How do I put more than one grid on a page?
You have to be careful when doing this, first of all. You need to use the 'embedded' model for all of them if you want to put as many on as you want without restriction. There is, however, a specific bit of code you need to put in between your GridMonger calls that will delete the structure that internally sets a number of parameters (its local scope, so its no big deal to delete it):
<cfscript>StructClear(ParameterGroup);</cfscript>
NOTE: Beginning with version 4.40, significant changes were made to GridMonger's underlying structure to allow better error reporting under ColdFusion version 5, and to just generally better encapsulate memory variables. For version 4.40+ use the following statement:
<cfscript> StructClear(GridParms); StructClear(LocalGrid); StructClear(TempGrid); StructClear(request.GridMonger); StructClear(request.GridArrays); </cfscript>
Please note the above code was tested ONLY on ColdFusion 6.1, but it should work everywhere.
Also, you should call all of your grids via cfincludes rather than piling on the config files and gridmonger call all at once. Finally, don't call /includes/gm_tophtml.cfm or /includes/gm_gottomhtml.cfm in between every grid. In fact, when using the embedded model you don't need these at all (although you should make sure the style sheet gets called somewhere).
|