|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--DHTMLSuite.tableWidget
Purpose of class: Make HTML tables sortable
Apply application look to the table
Create one object for each HTML table.
Remember to have both <THEAD> and <TBODY> in your table.
<DIV>
<table>
<thead>
<tr>
<td>Header cell</td>
<td>Header cell</td>
</tr>
</thead>
<tbody>
<tr>
<td>Table data</td>
<td>Table data</td>
</tr>
<tr>
<td>Table data</td>
<td>Table data</td>
</tr>
</tbody>
</table>
</div>
Also remember: If you put a table inside a non-displayed element, example an inactive tab(the tabView script), remember to create
and initialize the table objects before you create the tab objects. In some browsers, that's nescessary in order for the table to
display properly.
(demo 1)
Defined in dhtml-suite-for-applications.js
Author: Alf Magne Kalleland(www.dhtmlgoodies.com)
Version: 1.0
Field Summary | |
Object |
objectIndex
|
Object |
rowClickCallBackFunction
|
Object |
serversideSort
|
Object |
serversideSortAscending
|
Object |
serversideSortCurrentStartIndex
|
Object |
serversideSortExtraSearchCriterias
|
Object |
serversideSortFileName
|
Object |
setRowDblClickCallBackFunction
|
Object |
tableCurrentlySortedBy
|
Constructor Summary | |
DHTMLSuite.tableWidget
()
|
Method Summary | |
void
|
addNewColumn(columnContent,headerText,sortMethod)
Adds a new row to the table dynamically |
void
|
addNewRow(cellContent)
Adds a new row to the table dynamically |
Object
|
getServersideSortNumberOfRows(serversideSort)
Return numer of rows per page. |
void
|
init()
Initializes the table widget object |
void
|
reloadDataFromServer()
Simply reload data from server. |
void
|
resetServersideSortCurrentStartIndex()
Reset current server side sort start index It may be useful to call this method and then the reloadDataFromServer() method in case you want to reload data from the server starting with the first row in the record set. |
void
|
setColumnSort(columnSortArray)
How to sort the table |
void
|
setLayoutCss(newCssFile)
This function updates name of CSS file. |
void
|
setNoCssLayout()
No CSS layout |
void
|
setPageHandler(ref)
Specify a reference to a page handler for this widget (in case of server side sort) |
void
|
setRowClickCallBack(rowClickCallBackFunction)
This method specifies call back function to be called when a row is clicked. |
void
|
setRowDblClickCallBack(setRowDblClickCallBackFunction)
This method specifies call back function to be called when a row is double clicked. |
void
|
setServersideSearchCriterias(serversideSortExtraSearchCriterias)
This method is used to add extra params to the search url sent to the server. |
void
|
setServerSideSort(serversideSort)
This method is used to specify if you want to your tables to be sorted on the server or not. |
void
|
setServersideSortFileName(serversideSortFileName)
This method is used to specify which file to send the ajax request to when data should be sorted. |
void
|
setServersideSortNumberOfRows(serversideSortNumberOfRows)
Specify how many records to receive from the server ( server side sort ) |
void
|
setTableHeight(height)
Set height of table |
void
|
setTableId(idOfTable)
Set id of table, i.e. |
void
|
setTableWidth(width)
Set width of table |
void
|
sortTableByColumn(columnIndex,howToSort)
This method sorts a table by a column You can call this method after the call to init if you want to sort the table by a column when the table is beeing displayed. |
void
|
updateTableHeader(columnIndex,direction)
Updates the header of the table,i.e. |
Field Detail |
Object objectIndex
Object rowClickCallBackFunction
Object serversideSort
Object serversideSortAscending
Object serversideSortCurrentStartIndex
Object serversideSortExtraSearchCriterias
Object serversideSortFileName
Object setRowDblClickCallBackFunction
Object tableCurrentlySortedBy
Constructor Detail |
DHTMLSuite.tableWidget()
Method Detail |
void addNewColumn(columnContent,headerText,sortMethod)
Array
- columnContent=Array of strings-content of new cells.
String
- headerText=Text-column header
mixed
- sortMethod=How to sort the new column('N','S' or false)
void addNewRow(cellContent)
Array
- cellContent=Array of strings-cell content
Object getServersideSortNumberOfRows(serversideSort)
void init()
void reloadDataFromServer()
void resetServersideSortCurrentStartIndex()
void setColumnSort(columnSortArray)
Array
- columnSortArray=How to sort the columns in the table(An array of the items 'N','S' or false)
void setLayoutCss(newCssFile)
String
- newCssFile=(File name of CSS file, not path)
void setNoCssLayout()
void setPageHandler(ref)
tableWidgetPageHandler
- ref=Page handler reference
void setRowClickCallBack(rowClickCallBackFunction)
String
- rowClickCallBackFunction=(Row click-call back function)
void setRowDblClickCallBack(setRowDblClickCallBackFunction)
String
- setRowDblClickCallBackFunction=(Row click-call back function)
void setServersideSearchCriterias(serversideSortExtraSearchCriterias)
String
- serversideSortExtraSearchCriterias=String added to the url, DHTMLSuite.tableWidget.prototype.example = "&firstname=John&lastname=Doe";. This can be used in the sql query on the server.
void setServerSideSort(serversideSort)
Boolean
- serversideSort=Sort items on the server? (true=yes, false=no).
void setServersideSortFileName(serversideSortFileName)
String
- serversideSortFileName=Path to file on server. This file will receive the request, parse it and send back new table data.
void setServersideSortNumberOfRows(serversideSortNumberOfRows)
Integer
- serversideSortNumberOfRows=Number of rows
void setTableHeight(height)
Mixed
- height=(string if percentage height, integer if numeric/pixel height)
void setTableId(idOfTable)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |