The <netui-data:grid> tag renders data sets as an HTML table with the ability to page, sort, and filter the data set.
<netui-data:grid
[autoRender="boolean_autoRender"]
dataSource="expression_dataSource"
[imageRoot="string_imageRoot"]
name="string_or_expression_name" />
The rendered table consists of three parts:
- header
- data rows
- footer
These parts are structured in a grid as follows:
column 1: header | column 2: header | column 3: header |
column 1: data cell | column 2: data cell | column 3: data cell |
column 1: data cell | column 2: data cell | column 3: data cell |
column 1: data cell | column 2: data cell | column 3: data cell |
column 1: footer | column 2: footer | column 3: footer |
The grid is rendered either automatically or by nesting the following tags inside of a <netui-data:columns> tag:
If the grid is automatically rendered, the resulting HTML table is not sortable or filterable. Regardless of how a grid is rendered, a row is rendered for each item in the data set, unless a <netui-data:pager> tag is used to set the page size.
javax.sql.RowSet is the only type supported for rendering by the <netui-data:grid>. Any other types that are passed to the grid are illegal and an error will be reported in the JSP page.
This sample shows a <netui-data:grid> tag that writes out two <netui-data:anchorColumn> and one <netui-data:basicColumn> .
<netui-data:grid dataSource="{pageFlow.allRows}" name="{pageFlow.gridName}"> <netui-data:gridStyle styleClassPrefix="gridStyle"/> <netui-data:pager renderInHeader="true" action="pageAction" renderInFooter="true"/> <netui-data:columns filterAction="begin" sortAction="begin"> <netui-data:anchorColumn action="detailsItems" addRowId="true" title="Details"/> <netui-data:anchorColumn action="updateItems" addRowId="true" title="Edit"/> <netui-data:basicColumn filterable="true" title="Itemnumber" sortable="true" name="itemnumber"/> </netui-data:columns> </netui-data:grid>