Abstract
This document outlines the methods and properties of the Column child class contained within the datagrid control.
Currently this is a living document which I am using to build the documentation on the datagrid control, so if it is out of sync with the actual code then most likely it will be updated soon.
Design Goals
The purpose of the Column class is to provide for both the storage of column properties and for the manageing of it's self with regards to placement within the control. The goal is to ensure that the class will provide a centralized location in order to reduce code duplication within the datagrid control. The following tables will provide a list of methods and properties for the column class.
The column class will be directly accesible via javascript through the columns collection. For example mydatagrid.columns[1].label='A New Label'.
| Public Properties | ||
| Name | Description | |
| name | hmmm... do we need a name? Do we code for mydatagrid.columns.[name] yadda yadda yadda. Is that possible? Musings.... yes it is now that I think about it!!! Certainly we could create the object as a pointer within the control to the columns collection, that would work and be easy as hell to do. | |
| caption |
[string/html] required
Defines the label text displayed on the column heading.
|
|
| align |
string [left|right|center]
Indicates how the data in the column should be aligned within the column.
default left |
|
| width |
string [number{px|%|}] required
Indicates the default width of the column when the control is rendered. If px or % is not provided it is assumed to be px.
default 30px |
|
| maxWidth |
string [number{px|%|}]
Indicates the maximum width the column can take within the datagrid control. If px or % is not provided it is assumed to be px.
default none |
|
| minWidth |
string [number{px|%|}]
Indicates the manimum width the column can take within the datagrid control. If px or % is not provided it is assumed to be px.
default 30px |
|
| datatype |
mydatagrid.datatypes [dtString|dtMoney|dtNumber|dtInteger|dtDate|dtTime|dtDatetime] required
Indicates the underlying datatype of the data that will be displayed within the column. Use the datagrid datatypes which are accessable through with the mydatagrid.datatypes class.
Default mydatagrid.datatypes.dtString For example mydatagrid.columns[0].datatype=mydatagrid.datatypes.dtString |
|
| regExpMask |
javascript regular Expression
The regExpMask propery allows you to apply regular expressions to the underlying column data for display. Several regular expressions have been provided through the masks collection which can be accessed via mydatagrid.masks. Provided masks are:
|
|
| xpathElement |
string [xpath expression]
An xpath expression that leads to the element where the data can be found. See Traverse under k:bindings for inline serialization. If the GridContol has the select the select property set to call and you supply the following data:default null Musings... provide example |
|
| xpathAttribute |
string [attribute name]
Used in conjuction with xpatElement or on its own. Allows the data for the column to be pulled from a attribute within the underlying data.
default null |
|
| allowResize |
boolean
When set to false disables the ability to resize the column.
default true |
|
| allowSort |
boolean
When set to false disables the ability to sort the column.
default true |
|
| allowHide |
boolean
When set to false disables the ability to hide the column.
default true |
|
| allowFilter |
boolean
When set to false disables the ability to assign a filter with fsthe column.
default true |
|
| allowUpdate |
boolean
When set to false disables the ability to modify cell values in line in the column.
default false |
|
| Public Methods | ||
| Name | Description | |
| clearFilter | ||
| sort.ascending | ||
| sort.descending | ||
| slide.left | ||
| slide.right | ||
| hide | ||
| show | ||
| reset | ||
| disable | ||
| enable | ||