9.7. Class zzGridColumn


class zzGridColumn
Single column settings.

Property Summary
string alt
Alt text if the column is icon. Needed if the icon property is set to true or a URL. Default is ''.
string caption
Text in the heading of the column. Default is ''.
string className
CSS class name for the contents of the column. Default is null (no specific class name).
string or boolean icon
If this column will contain an icon. If this property is set to true, then the AJAX script will have to provide a URL of icon (like '/icons/busy.gif') for this field, and icons for each row can be different and reflect the state for this particular record.

You can also set this property to a string like '/icons/busy.gif', and in this case all rows in the grid will display the same icon in this column. This can be useful if you want to use the column to provide a common action for the row, like edit/delete. In this case the onclick or ondblclick event for the column must be set.

Default is false.
string name
Name of the column. Required property. Name must be unique across all columns. It does not have to be the same as in the database - you can actually use any name here, in particular, to conceal your database structure. In your server-side Ajax script you will provide a mapping of these zzGrid column names to database table fields or SQL expressions. It is recommended to use one-letter short names (this saves network bandwidth as well). No default value - you have to set this property.
Function onclick
Onclick event for the column. Function of type ClickFunction should be provided if you want to handle the onclick event for the column. Default is null (no onclick event).
Function ondblclick
Ondblclick event for the column. Function of type ClickFunction should be provided if you want to handle the doubleclick event for the column. Default is null (no event).
boolean sortable
If the column can be sorted by. Default is true.
boolean visible
If a column is visible in the grid. You may want to have hidden columns, for example, if you have a primary key, then this column can be hidden, and can be needed to do further manipulation with records, like viewing, editing or deleting a record. Hidden columns are handy if you want to use their values in the onclick event. Default is true.
int width
Width in pixels of the column. Default is 100.

9.8. Property Details

9.8.1. property string alt

Alt text if the column is icon. Needed if the icon property is set to true or a URL. Default is ''.

9.8.2. property string caption

Text in the heading of the column. Default is ''.

9.8.3. property string className

CSS class name for the contents of the column. Default is null (no specific class name).

9.8.4. property string or boolean icon

If this column will contain an icon. If this property is set to true, then the AJAX script will have to provide a URL of icon (like '/icons/busy.gif') for this field, and icons for each row can be different and reflect the state for this particular record.

You can also set this property to a string like '/icons/busy.gif', and in this case all rows in the grid will display the same icon in this column. This can be useful if you want to use the column to provide a common action for the row, like edit/delete. In this case the onclick or ondblclick event for the column must be set.

Default is false.
See also:

9.8.5. property string name

Name of the column. Required property. Name must be unique across all columns. It does not have to be the same as in the database - you can actually use any name here, in particular, to conceal your database structure. In your server-side Ajax script you will provide a mapping of these zzGrid column names to database table fields or SQL expressions. It is recommended to use one-letter short names (this saves network bandwidth as well). No default value - you have to set this property.

9.8.6. property Function onclick

Onclick event for the column. Function of type ClickFunction should be provided if you want to handle the onclick event for the column. Default is null (no onclick event).
See also:

9.8.7. property Function ondblclick

Ondblclick event for the column. Function of type ClickFunction should be provided if you want to handle the doubleclick event for the column. Default is null (no event).

9.8.8. property boolean sortable

If the column can be sorted by. Default is true.

9.8.9. property boolean visible

If a column is visible in the grid. You may want to have hidden columns, for example, if you have a primary key, then this column can be hidden, and can be needed to do further manipulation with records, like viewing, editing or deleting a record. Hidden columns are handy if you want to use their values in the onclick event. Default is true.

9.8.10. property int width

Width in pixels of the column. Default is 100.