|
jsm | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--JsmObject | +--JsmTable
Represents a table
Defined in net/sf/jsm/table/jsmTable.js
Field Summary | |
<private> String |
_actionCellSide
Defines if the actions cells should be displayed on the left or right side of the table; Default is 'right' |
<private> Hash |
_columnIdx2ColumnName
Mapping column idx to column name |
<private> Hash |
_columnIdx2Comparator
Mapping column idx to comparator functions |
<private> Array |
_columnIdx2FilterGenerationConfig
Array holding FilterGenerationConfigurations for filters generated by generateFilter() The value of the array is again an array with the 0th element being the widget and the 1st element being the filter |
<private> Hash |
_columnIdx2PropertyPath
Mapping column idx to property paths to store cell values back into JavaBeans |
<private> Hash |
_columnIdx2Widget
Mapping column idx to widget |
<private> Hash |
_columnName2ColumnIdx
Mapping column name to column idx |
<private> boolean |
_dirty
Indicates that at least one row of this table is dirty |
<private> Array |
_filters
Array holding Filter, eg. |
<private> Array |
_footer
Array holding the footer rows (JsmTr objects); |
<private> Array |
_footerActionCells
Array holding JsmActionCell objects to display in the footer row; |
<private> Array |
_headerActionCells
Array holding JsmActionCell objects to display in the header row; |
<private> Array |
_headerRow
Array holding JsmTh objects; can be null |
<private> String |
_noRowsToDisplayMessage
The message to show if there are no rows to display; default: There are currently no rows to display |
<private> int |
_pageingCurrentStartRow
The current start row when paging; defaults to 0 |
<private> int |
_pageingMaxRows
The amount of rows to show when paging; defaults to -1 |
<private> boolean |
_resizable
Is the table resizable; defaults to false |
<private> Array |
_rowActionCells
Array holding JsmActionCell objects to display in the data rows |
<private> Array |
_rows
Array holding the data rows (JsmTr objects); |
<private> boolean |
_showOnlyHeader
If set to true only the table header will be shown |
<private> int |
_sortColumn
the column idx by which the table is currently sorted; defaults to 0 |
<private> Object |
_sortOrder
The tables sorting order: ascending or descending; Values are 'asc' or 'desc' |
String |
containerId
The id of the element holding the table; Defaults to 'myTableContainer' |
String |
variableName
The name of the variable holding this JsmTable object; Defaults to 'myTable' |
Fields inherited from class JsmObject |
className, id, META_DATA_NAME_PROPERTY_PATH, META_DATA_NAME_VALUE, _attributes, _metaData
|
Constructor Summary | |
JsmTable
(<String> containerId, <String> variableName, <boolean> resizable)
Creates a new JsmTable object |
Method Summary | |
<private> boolean
|
_isNumberColumn(<int> columnIdx)
Determins if this column only hold numbers |
<private> Object
|
_updateRowIndex()
Update the idx of the JsmTr objects |
Object
|
addColumnName(<String> columnName, <int> columnIdx)
Add the name for a column so that they do not have to be refered to be idx |
Object
|
addComparator(columnIdxOrName, comparator)
Set the comparator function for this column |
Object
|
addFilter(filter)
Adds a filter; |
Object
|
addFilterConfig(columnIdxOrName, widget, filter)
Add filter configuration for generateFilter() to a column; If already widgets for editing are set it is optional to set them via this method. |
Object
|
addFooter(<JsmTr> tr)
Add a footer row to this table; Sets the rows meta data 'jsmRowType' to 'footer'. |
Object
|
addFooterActionCell(<JsmActionCell> theActionCell)
Add a global action Td; will be displayed in the footer row |
Object
|
addHeaderActionCell(<JsmActionCell> theActionCell)
Add a global action Td; will be displayed in the header row |
Object
|
addPropertyPath(columnIdxOrName, propertyPath)
Set the property path for this column to set a cells value back on the JavaBean |
Object
|
addRow(<JsmTr> tr, <boolean> renderImmediately)
Add a row to this table |
Object
|
addRowActionCell(<JsmActionCell> theActionCell)
Add a row action Td; will be displayed on side of each row |
Object
|
addRows(trs, <boolean> renderImmediately)
Add rows to this table |
Object
|
addWidget(columnIdxOrName, widget)
Add a widget to a column; This will be used for editing all cells of this column |
Object
|
cleanUpAfterSave()
Clean up after a save, eg. |
Object
|
focusOnFirstWidget()
Sets the focus on the first widget found |
Object
|
generateFilter(<String> filterContainerId, <Array> filterColumnIdxs, <int> horizontalSize)
Generates filter |
String
|
getActionCellSide()
Returns the side on which the action cells should be displayed |
int
|
getColumnIdx(<String> columnName)
Get column idx by column name |
String
|
getColumnName(<int> columnIdx)
Get column name by column idx |
Function
|
getComparator(<int> columnIdx)
Get the comparator function for this column |
String
|
getContainerId()
Get the id of the container displaying the table |
Array}
|
getFilterConfig(<int> columnIdx)
Get the filter configuration for a column |
Array
|
getFilteredRows()
Get the filtered data JsmTr rows; |
Array
|
getFilters()
Get all associated filters |
Array
|
getFooter()
Get the footer JsmTr objects; |
JsmTr
|
getHeaderRow()
Get the header row |
Object
|
getNode()
Get the node object; the model (this) will be attached to the node as property 'model' |
int
|
getPageingCurrentStartRow()
Gets the current start row for paging |
int
|
getPageingMaxRows()
Gets the max number of rows to show |
String
|
getPropertyPath(<int> columnIdx)
Get the property path for this column to set a cells value back on the JavaBean |
JsmTr
|
getRow(<int> trIdx)
Get the JsmTr object; same as getTr |
int
|
getRowCount()
Get the number of data JsmTr rows; |
Array
|
getRows()
Get the data JsmTr rows; |
int
|
getSortColumn()
|
int
|
getSortOrder()
|
JsmTd
|
getTd(<int> trIdx, <int> tdIdx)
Get the JsmTd object |
Array
|
getTds(<int> trIdx)
Get the JsmTd objects of this row |
JsmTr
|
getTr(<int> trIdx)
Get the JsmTr object |
Object
|
getValue(<int> trIdx, <int> tdIdx)
Get the value for the specified cell |
String
|
getVariableName()
Set the name of the variable holding this JsmTable object |
Object
|
getWidget(columnIdxOrName)
Get the widget of a column |
boolean
|
isDirty()
|
boolean
|
isShowOnlyHeader()
Should only the header be shown |
Object
|
removeFilters()
Remove all associated filters |
Object
|
removeRow(<int> idx)
Remove a row from this table |
Object
|
render()
Render this table into the container |
Object
|
saveAllRowsInEditMode()
Calles _jsmOnSaveRow for each row in edit mode |
Object
|
setActionCellSide(<String> leftOrRight)
Defines if the actions cells should be displayed on the left or right side of the table |
Object
|
setContainerId(<String> containerId)
Set the id of the container displaying the table |
Object
|
setDirty(<boolean> dirty)
Sets the dirty flag; if set to false will propagate this to the child rows |
Object
|
setHeaderRow(<JsmTr> tr)
Set the header row; Sets the rows meta data 'jsmRowType' to 'header'. |
Object
|
setNoRowsToDisplayMessage(<String> noRowsToDisplayMessage)
The message to display if there are no rows to diplay |
Object
|
setPageingCurrentStartRow(<int> pageingCurrentStartRow)
Sets the current start row for paging |
Object
|
setPageingMaxRows(<int> pageingMaxRows)
Sets the max number of rows to show |
Object
|
setShowOnlyHeader(<boolean> showOnlyHeader)
Determin if only the header should be shown |
Object
|
setSortColumn(<String/int> sortColumn)
Set the sorting column |
Object
|
setSortOrder(<String> sortOrder)
Set the sorting order |
Object
|
setValue(<int> trIdx, <int> tdIdx, <String> value)
Set the value for the specified cell |
Object
|
setVariableName(<String> variableName)
Set the name of the variable holding this JsmTable object |
Object
|
sort(columnIdxOrName)
Sort the rows |
Object
|
unSetEditModeForAllRows()
Sets the edit mode of every row to false |
Methods inherited from class JsmObject |
toString, identify, setId, getId, setAttribute, getAttribute, setMetaData, getMetaData, addAttributesToViewComponent
|
Field Detail |
<private> String _actionCellSide
<private> Hash _columnIdx2ColumnName
<private> Hash _columnIdx2Comparator
<private> Array _columnIdx2FilterGenerationConfig
<private> Hash _columnIdx2PropertyPath
<private> Hash _columnIdx2Widget
<private> Hash _columnName2ColumnIdx
<private> boolean _dirty
<private> Array _filters
<private> Array _footer
<private> Array _footerActionCells
<private> Array _headerActionCells
<private> Array _headerRow
<private> String _noRowsToDisplayMessage
<private> int _pageingCurrentStartRow
<private> int _pageingMaxRows
<private> boolean _resizable
<private> Array _rowActionCells
<private> Array _rows
<private> boolean _showOnlyHeader
<private> int _sortColumn
<private> Object _sortOrder
String containerId
String variableName
Constructor Detail |
JsmTable(<String> containerId, <String> variableName, <boolean> resizable)
containerId
- Optional: The id of the element holding the table; If not specified the default value is 'myTableContainer'
variableName
- Optional: The name of the variable holding this JsmTable object; If not specified the default value is 'myTable'
resizable
- Optional: Indicates if the table should be resizable; default is false
Method Detail |
<private> boolean _isNumberColumn(<int> columnIdx)
columnIdx
- The column index
<private> Object _updateRowIndex()
Object addColumnName(<String> columnName, <int> columnIdx)
columnName
-
columnIdx
-
Object addComparator(columnIdxOrName, comparator)
comparator
- {Function} A comparator function
int
- / String} columnIdxOrName
Object addFilter(filter)
filter
-
Object addFilterConfig(columnIdxOrName, widget, filter)
widget
- The widget to display as a filter
filter
-
int
- / String} columnIdxOrName
Object addFooter(<JsmTr> tr)
tr
- The row holding the JsmTd objects
Object addFooterActionCell(<JsmActionCell> theActionCell)
theActionCell
-
Object addHeaderActionCell(<JsmActionCell> theActionCell)
theActionCell
-
Object addPropertyPath(columnIdxOrName, propertyPath)
propertyPath
- {String} The propertyPath to set the cell value back on the JavaBean
int
- / String} columnIdxOrName
Object addRow(<JsmTr> tr, <boolean> renderImmediately)
tr
- The row holding the JsmTd objects
renderImmediately
- True if the added row should be rendered immediately
Object addRowActionCell(<JsmActionCell> theActionCell)
theActionCell
-
Object addRows(trs, <boolean> renderImmediately)
renderImmediately
- True if the added rows should be rendered immediately
Array
- } trs Array of JsmTd objects
Object addWidget(columnIdxOrName, widget)
widget
-
int
- || String} columnIdxOrName
Object cleanUpAfterSave()
Object focusOnFirstWidget()
Object generateFilter(<String> filterContainerId, <Array> filterColumnIdxs, <int> horizontalSize)
filterContainerId
- The id of the HTML element holding the filter
filterColumnIdxs
- Array of column indices; For these columns a filter widget will be generated
horizontalSize
- Optional: The number of filter widgets to display beside each other; defaults to 2
String getActionCellSide()
int getColumnIdx(<String> columnName)
columnName
-
String getColumnName(<int> columnIdx)
columnIdx
-
Function getComparator(<int> columnIdx)
columnIdx
-
String getContainerId()
Array} getFilterConfig(<int> columnIdx)
columnIdx
-
Array getFilteredRows()
Array getFilters()
Array getFooter()
JsmTr getHeaderRow()
Object getNode()
int getPageingCurrentStartRow()
int getPageingMaxRows()
String getPropertyPath(<int> columnIdx)
columnIdx
-
JsmTr getRow(<int> trIdx)
trIdx
- The row index
int getRowCount()
Array getRows()
int getSortColumn()
int getSortOrder()
JsmTd getTd(<int> trIdx, <int> tdIdx)
trIdx
- The row index
tdIdx
- The column index
Array getTds(<int> trIdx)
trIdx
- The row index
JsmTr getTr(<int> trIdx)
trIdx
- The row index
Object getValue(<int> trIdx, <int> tdIdx)
trIdx
- The row index
tdIdx
- The column index
String getVariableName()
Object getWidget(columnIdxOrName)
int
- || String} columnIdxOrName
boolean isDirty()
boolean isShowOnlyHeader()
Object removeFilters()
Object removeRow(<int> idx)
idx
- The row index
Object render()
Object saveAllRowsInEditMode()
Object setActionCellSide(<String> leftOrRight)
leftOrRight
- Set to 'left' or 'right'
Object setContainerId(<String> containerId)
containerId
-
Object setDirty(<boolean> dirty)
dirty
-
Object setHeaderRow(<JsmTr> tr)
tr
- The row holding the JsmTh objects
Object setNoRowsToDisplayMessage(<String> noRowsToDisplayMessage)
noRowsToDisplayMessage
-
Object setPageingCurrentStartRow(<int> pageingCurrentStartRow)
pageingCurrentStartRow
- Zero based
Object setPageingMaxRows(<int> pageingMaxRows)
pageingMaxRows
-
Object setShowOnlyHeader(<boolean> showOnlyHeader)
showOnlyHeader
-
Object setSortColumn(<String/int> sortColumn)
sortColumn
- The column index (the index is zero based) or the column name
Object setSortOrder(<String> sortOrder)
sortOrder
- 'asc' or 'desc'
Object setValue(<int> trIdx, <int> tdIdx, <String> value)
trIdx
- The row index
tdIdx
- The column index
value
- Can contain HTML tags
Object setVariableName(<String> variableName)
variableName
-
Object sort(columnIdxOrName)
columnIdxOrName
- (Optional) Column index or name of the colum to sort; if not specified will sort on the currently set {@see #_sortColumn}
Object unSetEditModeForAllRows()
|
jsm | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |