ComponentOne Query 8.0
Using Macros in Item Templates

You can define special macros (scripts) and include macro calls in item template HTML. They are useful when you have a substantial chunk of HTML (usually, a script) that you want to reuse in several template attributes. An example of such macro (script) is C1Q_Indent used in the default template file.

Every macro (script) must be defined in the template file as a separate attribute with a special name: Script:script_name

For example, in the default template file the script is defined as follows:

Example Title
Copy Code
<C1QProperty:Script:C1Q_Indent>

for (i=0; I < <C1Q_LEVEL>; i++)

       document.write("     ");

</C1QProperty:Script:C1Q_Indent>

To include a script call (a macro) into an item template, write the following in the template attribute’s HTML:

<C1Q_SCRIPT Name='script_name'>

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback