cancel
Showing results for 
Search instead for 
Did you mean: 

Binding Problem with ui5 Table (JS View)

Former Member
0 Kudos

Hello Community,

I've a problem, that I couldn't solve about binding data dynamically to the table.

https://stackoverflow.com/questions/48093072/ui5-data-binding-from-an-array-of-objects-js-view


I would be very happy , if any of you could tell me how to solve this problem.

Cheers.

Accepted Solutions (0)

Answers (2)

Answers (2)

iftah_peretz
Active Contributor
0 Kudos

Hi,

I do agree that you should post your question here and not link to it. In addition, providing with some sandbox example on JSfiddle/JS Bin or any one of those platforms would allow for a tested solution. As you haven't done that I will give an outline and try some code that might not work.

I don't understand your problem. If you found a solution that works:

"{" + elementId + "/stoff/0/STOFFTYP}";

why not loop over the array and build that ColumnListItems?

You can replace it in with the index number, something along these lines (adjust it correctly)


var path_STOFFTYP = "";
for (var i = 0; i < stoff.length; i++) {
   var path_STOFFTYP = "{" + elementId + "/stoff/" + i + "/STOFFTYP}";
    ...
}

If getting stoff array is the issue, it should be something like this

var stoff = oModel.getData().stoff;
Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Okyanus,

Could you please describe the issue here instead of linking it to another site.

Have you tried this:

oTable.bindItems({
	path : oData.bindingContext.getPath() + "/results/rs999",
	template: view.oInnerTemplate2
});
 

Instead of text, use "path" on your cell:

new sap.m.Text({
  path: "model>/" + elementId + "/stoff/STOFFTYP"
})

Regards,
Ivan