Add a New Item to a Table / List

后端 未结 2 2084
猫巷女王i
猫巷女王i 2020-11-28 16:55

I have a fragment / view written in XML which contains a simple table with some columns and one ColumnListItem:



        
2条回答
  •  盖世英雄少女心
    2020-11-28 17:21

    Try with this code below

    onAddButton: function(oEvent){
            var columnListItemNewLine = new sap.m.ColumnListItem({
                cells:[
                    new sap.m.Text({text: "1"}),
                    new sap.m.TextArea({value: "senf", rows: "6", width: 
                    "30%"}),
                    new sap.m.Input({type: "text", placeholder: "bla"}),
                    new sap.m.Input({type: "text", placeholder: "bla2"}),
                    new sap.m.DatePicker({placeholder: "bla3"}),
                    new sap.m.Datepicker({placeholder: "bla4"})
                    ]
            });
            this._oTable.removeAllItems();
            this._oTable.addItem(columnListItemNewLine);
        }
    

提交回复
热议问题