SAP HTML5 Open UI5 Fiori row repeater image link event press function

Paylaş.

 

<html>
<head>
<meta http-equiv=”X-UA-Compatible” content=”IE=edge” />
<meta http-equiv=”Content-Type” content=”text/html;charset=UTF-8″/>

<script src=”https://sapui5.hana.ondemand.com/resources/sap-ui-core.js”
id=”sap-ui-bootstrap”
data-sap-ui-libs=”sap.m,sap.ui.layout,sap.ui.commons”
data-sap-ui-theme=”sap_bluecrystal”
type=”text/javascript”>
</script>

</head>
<body class=”sapUiBody”>
<div id=”uiArea″></div>
</body>
</html>

<script>

var aData = [
{name: “Test one”,surname:”11111″},
{name: “Another test”,surname:”2222″},
{name: “test”,surname:”333333333″},
{name: “fourth”,surname:”444444″},
{name: “fifth”,surname:”5555″},

];

var oTable = new sap.ui.table.Table({
editable: false,
columns: [
new sap.ui.table.Column({
template: new sap.ui.commons.Link({
text: “{name}”,

press : function(e) {
var model = this.getModel();
var path = e.getSource().getBindingContext().getPath();
var obj = model.getProperty(path);

console.log(obj.surname);
alert(obj.surname);
}

})
}),
new sap.ui.table.Column({
template:new sap.ui.commons.Link({
text: “{surname}”,

})
})
]
});
oTable.placeAt(“uiArea”);

var oModel = new sap.ui.model.json.JSONModel();
oModel.setData(aData);
oTable.setModel(oModel);
oTable.bindRows(“/”);

var oButton = new sap.ui.commons.Button({
text: “TestButton”,
press: function() {
console.log(“——————————-“);
console.log(“Indices: ” + oTable.getSelectedIndices());
var rows = oTable.getRows();
console.log(“Rows: ” + rows.length);
for (var i = 0; i < rows.length; i++) {
// console.log(rows[i].getCells()[0].mProperties.text);
}
}
});

oButton.placeAt(“uiArea”);

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)