on 10-26-2017 2:45 PM
Hello Community,
could any of you know how to solve my following problem?
https://stackoverflow.com/questions/46956009/ui5-binding-items-to-tablerows-instead-of-tablecolumns
best regards, Okyanus
still didn't find any solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If I understand correctly you have to transpose the data first ( Transpose ) and then bind items normally.
Is that correct?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Okyanus,
If you visualize differently, you're essentially trying to bind the rows to the table itself!! Just that the "data" for your table as coming from the back-end needs to probably be re-structured. Maybe you could change it to something like this:
Lets call the properties to which the cells need to be bound as: "C1Data", "C2Data" and "C3Data"
In the view: Use 3 columns with column list item row template cells bound to C1Data, C2Data and C3Data.
Your data will look like
[ {"C1Data": "data for column1", "C2Data": "data for column2", "C3Data": "data for column3"},...]
var vergleichTable1 = new sap.m.Table(this.createId("vergleichTable1"), {
columns: [
new sap.m.Column({
header: new sap.m.Label({
text: "Header Text 1"
})
}),
new sap.m.Column({
header: new sap.m.Label({
text: "Header Text 2"
})
}),
new sap.m.Column({
header: new sap.m.Label({
text: "Header Text 3"
})
}),
],
items: {
path: '<path to your entity',
template: new sap.m.ColumnListItem({
cells: [
new sap.m.Text({
text: "{C1Data}"
}),
new sap.m.Text({
text: "{C2Data}"
}),
new sap.m.Text({
text: "{C3Data}"
})
]
})
}).addStyleClass("vergleichTable1");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.