-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhtml5.html
More file actions
79 lines (69 loc) · 2.63 KB
/
html5.html
File metadata and controls
79 lines (69 loc) · 2.63 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<title>Transformed Result Set</title>
<!-- Load UI5, select gold reflection theme and the "commons" and "table" control libraries -->
<script id='sap-ui-bootstrap' type='text/javascript'
src='https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js'
data-sap-ui-theme='sap_goldreflection'
data-sap-ui-libs='sap.ui.commons,sap.ui.table'></script>
<!--<script type="text/javascript" src="entireResultset.js"></script>-->
<script type="text/javascript" src="multiDimensionResultset.js"></script>
<script type="text/javascript" src="formatTransform.js"></script>
<script>
reformatIntoSimpleTuples(resultSetJSON, 'text');
// create the DataTable control
oTable = new sap.ui.table.Table({editable:true});
//The UI5 table consumes a javascript object of a different format than resultSetJSON;
// one with a broadly similar pattern to the newly created simple tuples
// define the Table columns
for (var i = 0; i < headerTuple.length; i++) {
var colID = "{RESULT/COL" + i.toString() + "}";
var oControl = new sap.ui.commons.TextView({text:colID}); // short binding notation
oTable.addColumn(new sap.ui.table.Column({label: new sap.ui.commons.Label({text: headerTuple[i]}), template: oControl }));
}
var resultJSONList = [];
for (var i = 0; i < rowTuples.length; i++) {
var resultObject = new Object();
for (var j = 0; j < rowTuples[i].length; j++) {
var colKey = "COL" + j.toString();
resultObject[colKey] = rowTuples[i][j];
}
var resultObjectOuter = new Object();
resultObjectOuter["RESULT"] = resultObject;
resultJSONList.push(resultObjectOuter);
}
var allResultObject = new Object();
allResultObject["RESULTS"] = resultJSONList;
// create a JSONModel, fill in the data and bind the Table to this model
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData(allResultObject);
oTable.setModel(oModel);
oTable.bindRows("/RESULTS");
// finally place the Table into the UI
oTable.placeAt("content");
</script>
<script>
jQuery.sap.includeStyleSheet("postStyle.css";
</script>
<script>
$( document ).ready(function() {
var rows = oTable.getRows();
for (var k = 0; k < rows.length; k++) {
var cells = rows[k].getCells();
for (var l = 0; l < cells.length; l++) {
try{
var currCell = cells[l]
currCell.toggleStyleClass(repeatMask[k][l]);
}
catch(exc){}
}
}
});
</script>
</head>
<body class='sapUiBody'>
<div id='content'></div>
</body>
</html>