Class DHTMLSuite.tableWidget

Object
   |
   +--DHTMLSuite.tableWidget

class 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

objectIndex

Object objectIndex

rowClickCallBackFunction

Object rowClickCallBackFunction

serversideSort

Object serversideSort

serversideSortAscending

Object serversideSortAscending

serversideSortCurrentStartIndex

Object serversideSortCurrentStartIndex

serversideSortExtraSearchCriterias

Object serversideSortExtraSearchCriterias

serversideSortFileName

Object serversideSortFileName

setRowDblClickCallBackFunction

Object setRowDblClickCallBackFunction

tableCurrentlySortedBy

Object tableCurrentlySortedBy

Constructor Detail

DHTMLSuite.tableWidget

DHTMLSuite.tableWidget()

Method Detail

addNewColumn

void addNewColumn(columnContent,headerText,sortMethod)

addNewRow

void addNewRow(cellContent)

getServersideSortNumberOfRows

Object getServersideSortNumberOfRows(serversideSort)

init

void init()

reloadDataFromServer

void reloadDataFromServer()

resetServersideSortCurrentStartIndex

void resetServersideSortCurrentStartIndex()

setColumnSort

void setColumnSort(columnSortArray)

setLayoutCss

void setLayoutCss(newCssFile)

setNoCssLayout

void setNoCssLayout()

setPageHandler

void setPageHandler(ref)

setRowClickCallBack

void setRowClickCallBack(rowClickCallBackFunction)

setRowDblClickCallBack

void setRowDblClickCallBack(setRowDblClickCallBackFunction)

setServersideSearchCriterias

void setServersideSearchCriterias(serversideSortExtraSearchCriterias)

setServerSideSort

void setServerSideSort(serversideSort)

setServersideSortFileName

void setServersideSortFileName(serversideSortFileName)

setServersideSortNumberOfRows

void setServersideSortNumberOfRows(serversideSortNumberOfRows)

setTableHeight

void setTableHeight(height)

setTableId

void setTableId(idOfTable)