This is the base class, representing the grid.
new WebFXGrid(aData);
new WebFXGrid(nRows, nCols);
| Name | Type | Descripton |
aData | String[][] | A two dimensional array containing the number of rows and columns desired. Unless the array is empty the values found will be used to populate the appropiate cells. |
nRows | Number | Desired number of rows |
nCols | Number | Desired number of columns |
| Name | Description |
| Name | Type | Descripton |
| None. | ||
| Name | Description | |||||||||||||||
addColSyntax
Arguments
Return Type
| Adds a new column to the grid | |||||||||||||||
addRowSyntax
Arguments
Return Type
| Adds a new column to the grid | |||||||||||||||
calcSizeSyntax
ArgumentsNo Arguments. Return Type
| Re-Calculates the size of the grid itself and all it's sub elements | |||||||||||||||
dumpSyntax
Arguments
Return Type
| Dumps the content of the grid as a long string, formatted as a query string, making it suitable for usage with a back-end. See the backend introduction for further information about this method. | |||||||||||||||
dumpMatrixSyntax
ArgumentsNo Arguments. Return Type
| Deprecated - see getGridData. | |||||||||||||||
findSyntax
Arguments
Return Type
| Highlights the first row containing a cell that matches the supplied condition, It's quite useless, subclass it if you need a proper search function. | |||||||||||||||
focusSyntax
ArgumentsNo Arguments. Return Type
| Changes focus to the grid | |||||||||||||||
getColSizesSyntax
ArgumentsNo Arguments. Return Type
| Returns an array containing the column sizes. | |||||||||||||||
getGridDataSyntax
ArgumentsNo Arguments. Return Type
| Returns the content of the grid as a two dimensional array. | |||||||||||||||
getSelectedSyntax
ArgumentsNo Arguments. Return Type
| Returns a reference to the selected rows <tr> element. | |||||||||||||||
getShowSidSyntax
ArgumentsNo Arguments. Return Type
| Returns the ShowSid flag, see setShowSid. | |||||||||||||||
removeRowSyntax
Arguments
Return Type
| Removes the specified row, or if no row is specified the selected one. | |||||||||||||||
selectFirstSyntax
ArgumentsNo Arguments. Return Type
| Selects the first row. | |||||||||||||||
selectLastSyntax
ArgumentsNo Arguments. Return Type
| Selects the last row. | |||||||||||||||
setAutoExpandSyntax
Arguments
Return Type
| Sets the autoExpand flag. If true a new row will automatically be added to the grid once the last one is modified. Default is false. | |||||||||||||||
setCellStylesSyntax
Arguments
Return Type
| Assigns an individual css string to each cell | |||||||||||||||
setCellValueSyntax
Arguments
Return Type
| Sets the value of a cell | |||||||||||||||
setColDefaultSyntax
Arguments
Return Type
| Sets the default values for each column | |||||||||||||||
setColFlagsSyntax
Arguments
Return Type
| Sets the column flags, preferably used when creating the grid. | |||||||||||||||
setColLengthsSyntax
Arguments
Return Type
| Sets the maximum allowed length for each column. (Only applies to text fields, equivalent of the maxlength property) | |||||||||||||||
setColSizesSyntax
Arguments
Return Type
| Sets the column sizes | |||||||||||||||
setColTypesSyntax
Arguments
Return Type
| Sets the column types, limiting and verifying the content. For example a column with the type int may only contain digits, while a String Column may contain anything. The column type will also affect the sorting functionality. Preferably used when creating the grid. | |||||||||||||||
setHeadersSyntax
Arguments
Return Type
| Sets the column headers, preferably used when creating the grid. | |||||||||||||||
setHideBoxOnBlurSyntax
Arguments
Return Type
| Sets the hideBoxOnBlur flag. If true the edit box will be hidden on blur. Default is false. | |||||||||||||||
setIdSyntax
Arguments
Return Type
| Sets the id for a certain row | |||||||||||||||
setLinkDataSyntax
Arguments
Return Type
| Sets the link data (presented as a drop down menu) for each column, see the usage section for further information. Preferably used when creating the grid. | |||||||||||||||
setNewIdsSyntax
Arguments
Return Type
| Sets the id for on or more rows that doesn't have any, used to assign ids to rows once they have been created. The value -1 is treated as a fag indicating that the save operation failed, thus marking the row as not saved. | |||||||||||||||
setRowsServerIdsSyntax
Arguments
Return Type
| Sets the id for all rows, preferably used when creating the grid. | |||||||||||||||
setShowSidSyntax
Arguments
Return Type
| Sets the ShowSid flag. If true the id column will display the row ids, if false the row numbers will be displayed, and every second row will be a slightly different color. | |||||||||||||||
setSizeSyntax
Arguments
Return Type
| Resize the grid using the supplied parameters, will automatically invoke the calcSize method afterwards. | |||||||||||||||
setUriSyntax
Arguments
Return Type
| Sets the URI that will be used as a base for the dump method, the dump data will be appended to whatever this is set to. See the backend introduction for further information. | |||||||||||||||
sortSyntax
Arguments
Return Type
| Sorts the grid by one of the columns. | |||||||||||||||
toStringSyntax
Arguments
Return Type
| This is the method that generates the actual HTML code for the grid. |
| Name | Type | Descripton |
autoExpand | Boolean | If true a new row will automatically be added to the grid once the last one is modified. Default is false. |
colDefault | String[] | Read only. An array containing the column defaults, use setColDefault to modify. |
colFlags | Number[] | Read only. An array containing the column flags, use setColFlags to modify. |
colLengths | Number[] | Read only. An array containing the column lengths, use setColLengths to modify. |
colLinkData | String[] | Read only. An array containing the column link data, use setLinkData to modify. |
cols | Number | Read only. The number of columns in the grid. |
colSizes | Number[] | Read only. An array containing the column sizes, use setColSizes to modify. |
colTypes | Number[] | Read only. An array containing the column types, use setColTypes to modify. |
defColSize | Number | The default column size. |
flags | Number | Permission flags, affecting the entire grid according to this bitmap: 1 - update, 2 - insert, 4 - delete - The default value is 7. |
groupByFirst | Boolean | Deprecated. If set to true the rows will be grouped by the first column, collapsing the cells with matching values. - This field is deprecated and will be removed in a future version, however no replacement yet implemented. |
headers | String[] | Read only. An array containing the column headers, use setHeaders to modify. |
hideBoxOnBlur | Boolean | If true the edit box will be hidden on blur. Default is false. |
minimal | Number | The minimal with of a cell in edit mode, if the width of the column is less than this value, the editbox will span additional columns until this value has been reached. |
resizeArea | Number | The width of the area between columns in the grid header that can be grabbed, and used to resize the columns. Default value is 7. |
resizeAreaV | Number | Same as resizeArea however this indicates the size of the area in which the cursor will change to indicate resizable rather than the actual area. Default value is 5. |
rows | WebFXGridRow[] | Read only. An array containing the rows of the grid. |
| Name | Descripton |
onChange | Fires when a change has been made. |
onColResize | Fires when a column has been resized. |
onNewRow | Fires when a new row has been added. |
onSelect | Fires when a row has been selected. |
onSort | Fires when the grid is sorted. |
None.
This class represents a row.
new WebFXGridRow(aData[, sid[, bUnescapeData]]);
new WebFXGridRow([nCols[, sid[, bUnescapeData]]]);
| Name | Type | Descripton |
aData | String[] | An array containing the same number of elements as the row should have columns. Unless the array is empty the values found will be used to populate the appropiate cells. |
nCols | Number | Desired number of columns |
sid | Number | The row sid, or server id. |
bUnescapeData | Boolean | If true the supplied data will be parsed through the unescape function before used to populate the cells. Default is false." |
| Name | Description |
| Name | Type | Descripton |
| None. | ||
| Name | Description | ||||||
deselectSyntax
Arguments
Return Type
| Restores the original style of the row. | ||||||
outSyntax
Arguments
Return Type
| Disables the mouse over effect. Automatically executed on mouse out. | ||||||
overSyntax
Arguments
Return Type
| Enables a mouse over effect that highlights the row. Automatically executed on mouse over. | ||||||
selectSyntax
Arguments
Return Type
| Selects the row and updates the style of it to indicate that it has been selected. Also executes the deselect method on the previously selected row and fires the onSelect event. |
| Name | Type | Descripton |
cells | WebFXGridCells[] | Read only. An array containing the cells the row consists of. |
id | String | Read only. A unique name used to identify the html element that will be generated. |
parent | WebFXGrid | Read only. A reference to the parent grid. |
sid | Number | The sid, or server id. |
| Name | Descripton |
| None. | |
None.
This class represents a cell.
new WebFXGridCell([sValue]);
| Name | Type | Descripton |
sValue | String | The cell value |
| Name | Description |
| Name | Type | Descripton |
| None. | ||
| Name | Description | ||||
clickSyntax
Arguments
Return Type
| Enables edit mode for the cell. This method is executed when a cell is clicked on, hence the name. |
| Name | Type | Descripton |
id | String | Read only. A unique name used to identify the html element that will be generated. |
index | Number | Read only. The cell index. |
parent | String | Read only. A reference to the parent row. |
style | String | A css string describing the style of the cell. |
value | String | Read only. The cell value. To modify use the WebFXGrid setCellValue method. |
| Name | Descripton |
| None. | |
None.
History & Introduction
Usage
API
Backend - Introduction
Backend - Perl (cgi/mod_perl)
Backend - C++ (cgi/isapi)
Backend - Java (servlet)
Demo
Download