Created
August 23, 2014 18:05
-
-
Save dennisseah/1e895f799e94ef6db637 to your computer and use it in GitHub Desktop.
SAPUI5: multi select in sap.m.List without icons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<script id="sap-ui-bootstrap" | |
type="text/javascript" | |
data-sap-ui-libs="sap.m" | |
data-sap-ui-theme="sap_bluecrystal" | |
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"> | |
</script> | |
<style> | |
.no-checkbox-please .sapMLIBSelectM { | |
display:none | |
} | |
</style> | |
<script> | |
jQuery(function() { | |
var myData = { | |
"fruits":[ | |
{"item":"Apple"}, | |
{"item":"Orange"}, | |
{"item":"Banana"}, | |
{"item":"Pineapple"}, | |
{"item":"Mango"}, | |
{"item":"Strawberry"}, | |
{"item":"Jackfruit"}, | |
{"item":"Watermelon"}, | |
{"item":"Muskmelon"}, | |
{"item":"Grapes"}, | |
{"item":"Drumsticks"}, | |
{"item":"Kiwi"}, | |
{"item":"Figs"}, | |
{"item":"Lychee"}, | |
{"item":"Gooseberry"}, | |
{"item":"Anon"} | |
] | |
} | |
var oModel = new sap.ui.model.json.JSONModel(); | |
oModel.setData(myData); | |
var itemTemplate = new sap.m.StandardListItem({ | |
title : "{item}" | |
}); | |
var oList1 = new sap.m.List({ | |
width : '250px', | |
includeItemInSelection: true, | |
mode:'MultiSelect' | |
}).addStyleClass('no-checkbox-please'); | |
oList1.setModel(oModel); | |
oList1.bindAggregation("items","/fruits", itemTemplate); | |
oList1.placeAt("content"); | |
}); | |
</script> | |
</head> | |
<body class="sapUiBody"> | |
<div id="content"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment