setArrayAttributes()

This method is used to specify attributes for the list of dialogs. The attributes to specify are TTY attributes (BOLD, DIM, etc.) or a custom style.

In an INPUT ARRAY or DISPLAY ARRAY dialog, this method specifies attributes for each cell or for an entire row.

For dialogs with only one screen array defined, you can use the setCellAttributes() method.

Syntax

setArrayAttributes(

scr_rec STRING,

attr type)

scr_rec is the name of the screen record specifying the list to be decorated;

attr is a program array defining the cell attributes;

type can be:

Possible Attributes

Code Example:

DEFINE tab1 DYNAMIC ARRAY OF RECORD
       		f1   STRING
       END RECORD
DEFINE d ui.Dialog

DEFINE attributes DYNAMIC ARRAY OF RECORD
			field1 STRING
       END RECORD  
MAIN
	OPEN WINDOW w1 WITH FORM "table_form" ATTRIBUTE (BORDER)
	
	LET tab1[1].f1 = "Current:"
	LET tab1[2].f1 = "Loading..."
	LET tab1[3].f1 = "Request"
	LET tab1[4].f1 = "Response"
    LET attributes[2].field1 = "style=\loading\""
	LET attributes[3].field1 = "style=\"request\""
	LET attributes[4].field1 = "style=\"response\""
    DISPLAY ARRAY tab1 TO tab.* 
    	BEFORE DISPLAY
    		LET d = ui.dialog.getCurrent()
    		CALL d.setArrayAttributes( "tab", ATTRIBUTES )
    END DISPLAY
	CALL fgl_getkey()
END MAIN	

Form Example:

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://namespaces.querix.com/2015/fglForms" title="New Form 1">
	<form.rootContainer>
		<Table preferredSize="300,300" visible="true" fieldTable="" identifier="tab">
			<TableColumn text="column" resizable="true" visible="true" fieldTable="" identifier="tc_f1">
				<TableColumn.columnLength>
					<GridLength gridLengthValue=""/>
				</TableColumn.columnLength>
				<TextField visible="true" fieldTable="" identifier="f1"/>
			</TableColumn>
		</Table>
	</form.rootContainer>
	<form.screenRecords>
		<ScreenRecord identifier="tab" fields="f1"/>
	</form.screenRecords>
</form>

CSS Example:

.qx-identifier-tab .qx-tbody [data-rownum].qx-c-response {
	background-color: rgb(255, 0, 0);
}

.qx-identifier-tab .qx-tbody [data-rownum].qx-c-loading {
	background-color: rgb(0, 255, 0);
}

.qx-identifier-tab .qx-tbody [data-rownum].qx-c-request {
	background-color: rgb(0, 0, 255);
}

 

Contact Us

Privacy Policy

Copyright © 2026 Querix, (UK) Ltd.