Author: abelevich
Date: 2007-04-26 12:02:22 -0400 (Thu, 26 Apr 2007)
New Revision: 572
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml
Log:
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml
===================================================================
---
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml 2007-04-26
15:50:21 UTC (rev 571)
+++
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml 2007-04-26
16:02:22 UTC (rev 572)
@@ -25,67 +25,15 @@
function onSort(column, order) {
alert("Column " + column + " sorted in " + order + "
order.");
}
-
- var ExampleGrid = function() {
- return {
- init : function() {
- var currTime = (new Date()).getTime();
- ClientUILib.log(ClientUILogger.WARNING, "Document loaded over " +
(currTime - ClientUILib.startTime) + " miliseconds.");
-
- var data = [];
- for (var index = 0; index < 100; index++) {
- data[index] = [];
- for (var index2 = 0; index2 < 6; index2++) {
- data[index][index2] = index2 + " : " + index;
- }
- data[index][6] = index%2 ? "value 1" : "value 2";
- }
-
- dataModel = new ClientUI.controls.grid.ArrayDataModel(data);
-
- var templates = [
- {pane: GridLayout_Enum.HEADER, ref: "GridHeaderTemplate"},
- {pane: GridLayout_Enum.BODY, ref: "GridBodyTemplate"},
- {pane: GridLayout_Enum.FOOTER, ref: "GridFooterTemplate"}
- ];
-
- ClientUILib.log(ClientUILogger.WARNING, "DataModel created over " + ((new
Date()).getTime() - currTime) + " miliseconds.");
- currTime = (new Date()).getTime();
-
- // create the Grid
- var grid = new ClientUI.controls.grid.Grid('GridContainer',
dataModel, templates,
- {
- showIndexColumn: true,
- indexColumnWidth: 40
- }
- );
- ClientUILib.log(ClientUILogger.WARNING, "Grid control created over " +
((new Date()).getTime() - currTime) + " miliseconds.");
-
- grid.updateLayout();
- Event.observe(grid.eventOnSort, "grid on sort", onSort);
-
- setTimeout(function() {
- currTime = (new Date()).getTime();
- grid.loadData();
- ClientUILib.log(ClientUILogger.WARNING, "Grid data loaded over " + ((new
Date()).getTime() - currTime) + " miliseconds.");
- }.bind(this), 100);
-
- ClientUILib.log(ClientUILogger.WARNING, "Done.");
- }
- }
- }();
-
- Event.observe(window, 'load', ExampleGrid.init);
-
-
//]]>
</script>
</head>
<body>
+
<sg:scrollable-grid>
</sg:scrollable-grid>
- </body>
+ </body>
</html>
\ No newline at end of file
Show replies by date