Skip to Content
0

Binding Problem with ui5 Table (JS View)

Jan 04 at 11:58 AM

40

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Ivan Mirisola
Jan 04 at 04:18 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Iftah Peretz
Jan 05 at 08:14 AM
0

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;
Share
10 |10000 characters needed characters left characters exceeded