JavaScript

A5.ListBoxgetColumnarHTML Method

Syntax

A5.ListBox.getColumnarHTML(data)

Arguments

dataarray

The data to use to generate the columnar HTML.

Description

Generate columnar HTML base off the current layout of the list.

Discussion

When using a columnar layout for the list it is often desirable to be able to have custom HTML that matches the column layout. The "getColumnarHTML" generates HTML that will match the current list layout.

An array of objects is passed into the method, with each object representing a row to draw. Each row can have a "className" property optionally defined The object must contain a "columns" property, which is an array of sparse column mappings. Each item in the "columns" array for each row can optional have a "className" defined as well as the "index" of the column to put HTML in.

Example

// To get a pointer to the A5.ListBox class see {dialog.object}.getControl
// assume lObj is a pointer to an instance of the A5.ListBox class
var html = lObj.getColumnarHTML([
	{
		className: 'rowSum',
		columns: [{ className: 'sumLabel', index: 3, html: 'Sub-Total' },{ index: 4, html: '$124.56' }]
	},
	{
		className: 'rowSum',
		columns: [{ className: 'sumLabel', index: 3, html: 'Tax' },{ index: 4, html: '$12.46' }]
	},
	{
		className: 'rowSumTotal',
		columns: [{ className: 'sumLabel', index: 3, html: 'Total' },{ index: 4, html: '$137.02' }]
	}
]); // html will include 3 rows with data displayed in 4th and 5th visible columns

See Also