Start a new topic

Controlling what columns to show in Grids and Tables

Using the script language it is possible to configure what columns to show in a grid or Table based on data from the model.

Below is a simple example where we start on a primitive data type and look at an attribute on the CompuMethod to decide what columns to show. If the attribute has the value ‘IDENTICAL’ or ‘LINEAR’ we show one set of attributes in the grid and in all other cases we show another set:

 

Identical or Linear:

image


 

Other cases:

image


 

Meta model:

image


This is the XML Definition:

  

<Grid>
	<Columns>       
		<Choose>
			<When test="'IDENTICAL' in /ARCG.Select(@ARCB) or 'LINEAR' in /ARCG.Select(@ARCB) ">
				<TextColumn type="ARCB" caption="Category" width="150">#{?/ARCG.Select(@ARCB)}</TextColumn>
				<ItemAttributeColumn type="ARLP" caption="Physical Lower Limit" readOnly="false" width="150"/>
				<ItemAttributeColumn type="ARLV" caption="Physical Upper Limit" readOnly="false" width="150"/>                   
			</When>
			<Otherwise>
				<TextColumn type="ARCB" caption="Category" width="150">#{?/ARCG.Select(@ARCB)}</TextColumn>   
				<ItemAttributeColumn type="ARLO" caption="Internal Lower Limit" readOnly="false" width="150"/>
				<ItemAttributeColumn type="ARLU" caption="Internal Upper Limit" readOnly="false" width="150"/>                
			</Otherwise>  
		</Choose>  
	</Columns>
	<Row/>
</Grid>

  


 

 

Login to post a comment