/
liquidDataTable.gsp
51 lines (45 loc) · 1.85 KB
/
liquidDataTable.gsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<%--
Created by IntelliJ IDEA.
User: swestfall
Date: 6/9/11
Time: 5:38 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
<title>Example of YUI DataTable with Local Data</title>
<meta name="layout" content="main"/>
</head>
<body>
<div>Example of a local data source</div>
<a href="http://developer.yahoo.com/yui/examples/datatable/dt_basic.html">YUI 2 Example</a>
<%
def columns = [
[key: "id", sortable: true, resizeable: true],
[key: "company", sortable: true, resizeable: true],
[key: "price", sortable: true, resizeable: true, formatter: 'currency'],
[key: "change", sortable: true, resizeable: true],
[key: "percentChange", sortable: true, resizeable: true],
[key: "lastChange", sortable: true, resizeable: true, formatter: '@grails.yui.formatters.formatDate']
]
%>
<div style="height: width: 100%; padding: 20px;">
<local:liquidYuiDataTable
id="testTable"
columns="${columns}"
events="${[]}"
namespace="grails.yui.components"
config="${[caption: 'DataTable Caption']}">
<yuiWidget:yuiLocalDataSource
data="${stocks}"
config="${[
responseType : '@YAHOO.util.DataSource.TYPE_JSARRAY',
responseSchema: [
fields: ['id', 'company', 'price', 'change', 'percentChange', 'lastChange']
]
]}"/>
</local:liquidYuiDataTable>
</div>
</body>
</html>