Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions webapp/controller/App.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ sap.ui.define([
"sap/base/strings/formatMessage",
"sap/ui/core/BarColor",
"sap/ui/demo/todo/util/Helper",
], (Controller, Filter, FilterOperator, formatMessage, BarColor, Helper) => {
"sap/ui/core/Element",
"sap/ui/Device",
"sap/ui/model/json/JSONModel",
], (Controller, Filter, FilterOperator, formatMessage, BarColor, Helper, Element, Device, JSONModel) => {
"use strict";

return Controller.extend("sap.ui.demo.todo.controller.App", {
Expand All @@ -15,8 +18,8 @@ sap.ui.define([
this.aTabFilters = [];
this.BarColor = BarColor;

this.getView().setModel(new sap.ui.model.json.JSONModel({
isMobile: sap.ui.Device.browser.mobile
this.getView().setModel(new JSONModel({
isMobile: Device.browser.mobile
}), "view");
},

Expand All @@ -31,7 +34,7 @@ sap.ui.define([
enabled: "{/itemsRemovable}",
icon: "sap-icon://delete",
text: "{i18n>CLEAR_COMPLETED}",
tap: this.onClearCompleted.bind(this),
press: this.onClearCompleted.bind(this),
});

this.byId("toolbar").addContent(clearBtn);
Expand Down Expand Up @@ -151,7 +154,7 @@ sap.ui.define([
},

_applyListFilters() {
const oList = sap.ui.getCore().byId("container-todo---app--todoList");
const oList = Element.getElementById("container-todo---app--todoList");
// const oList = this.byId("todoList");
const oBinding = oList.getBinding("items");

Expand Down
7 changes: 3 additions & 4 deletions webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
src="resources/sap-ui-core.js"
data-sap-ui-libs="sap.m"
data-sap-ui-xx-wait-for-theme="true"
data-sap-ui-bindingSyntax="complex"
data-sap-ui-theme="sap_platinum"
data-sap-ui-resourceRoots='{
data-sap-ui-resource-roots='{
"sap.ui.demo.todo": "./"
}'
data-sap-ui-onInit="module:sap/ui/core/ComponentSupport"
data-sap-ui-compatVersion="edge"
data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
data-sap-ui-compat-version="edge"
data-sap-ui-async="true">
</script>
</head>
Expand Down
8 changes: 2 additions & 6 deletions webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,15 @@
"uri": "model/todoitems.json"
},
"businessData": {
"dataSource": "businessData",
"settings": {
"synchronizationMode": "None"
}
"dataSource": "businessData"
}
},
"resources": {
"css": [
{
"uri": "css/styles.css"
}
],
"js": []
]
}
}
}
2 changes: 1 addition & 1 deletion webapp/view/App.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<SegmentedButtonItem text="{i18n>LABEL_COMPLETED}" key="completed"/>
</items>
</SegmentedButton>
<Button id="clearCompleted" enabled="{/itemsRemovable}" icon="sap-icon://delete" text="{i18n>CLEAR_COMPLETED}" tap="onClearCompleted"/>
<Button id="clearCompleted" enabled="{/itemsRemovable}" icon="sap-icon://delete" text="{i18n>CLEAR_COMPLETED}" press=".onClearCompleted"/>
</OverflowToolbar>
</headerToolbar>
<infoToolbar>
Expand Down