Skip to Content
avatar image
Former Member

How can I to add manually a row without binding?

Hi, I'm trying to add a row manually to a sap.m.table without success

I have been seeing it is posible in sap.ui but not in sap.m:

var row = new sap.ui.table.Row("row1",{

                     label : new sap.ui.commons.Label("l1",{

                                  text: "Row1"

                           })

              });

                     oTable.addRow(row);

I have to verify if in my json rest field date is empty, then I have to put an input date, else then I have to put a label text.

How can I to do this requirement with sap.m.table?

Thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 13, 2015 at 08:57 PM

    Hi Miguel,

    Sure this is possible. What you need to do is use the method "addItem" of the sap.m.Table. Pass in any sap.m.ListItemBase control as a parameter.

    See here for the API - OpenUI5 SDK - Demo Kit

    And here is the API for sap.m.ListItemBase (choose an appropriate subclass) - OpenUI5 SDK - Demo Kit

    Hope this helps!

    Oli

    Add comment
    10|10000 characters needed characters exceeded