Skip to Content
avatar image
Former Member

Binding Problem with ui5 Table (JS View)

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 04 at 04:18 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05 at 08:14 AM

    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;
    Add comment
    10|10000 characters needed characters exceeded