-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComponent.js
More file actions
47 lines (39 loc) · 1.11 KB
/
Component.js
File metadata and controls
47 lines (39 loc) · 1.11 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
/*
Component details:
- Main Control: sap.m.SplitApp (wrapped in sap.m.Shell to center app on screen
and limit width - remove if you want a fullscreen app)
- Views: XML
- Navigation: EventBus
*/
/*globals FastClick*/
(function() {
"use strict";
jQuery.sap.declare("sap.ui.demo.Component");
sap.ui.core.UIComponent.extend("sap.ui.demo.Component", {
createContent: function() {
// create root view
var oView = sap.ui.view({
id: "idViewRoot",
viewName: "sap.ui.demo.view.Root",
type: "XML",
viewData: {
component: this
}
});
// set data model on root view
oView.setModel(new sap.ui.model.json.JSONModel("model/mock.json"));
// set device model
var deviceModel = new sap.ui.model.json.JSONModel({
isPhone: jQuery.device.is.phone,
listMode: (jQuery.device.is.phone) ? "None" : "SingleSelectMaster",
listItemType: (jQuery.device.is.phone) ? "Active" : "Inactive"
});
deviceModel.setDefaultBindingMode("OneWay");
oView.setModel(deviceModel, "device");
return oView;
},
onAfterRendering: function() {
FastClick.attach(document.body);
}
});
}());