Вам необходимо добавить новый столбец с обязательным свойством
addNewCol: function(oEvent) {
var oTable = this.byId("customerTable");
var oCol = new sap.m.Column({
label: customer_Ext[i].fieldlabel,
template: "EXT_FLDS/PRINTING_NUM/fieldvalue", //Updated PATH, Update your binding property from customerJSONData model
});
oTable.addColumn(oCol);
}
Существующие customerJSONData
Данные модели
[
{"CUSTOMER_ID":"200","CUSTOMER_NAME":"RF","ADDRESS_LINE_1":"CV","ADDRESS_LINE_2":"5988","PRIVATE_NUMBER":"YY"},
{"CUSTOMER_ID":"80","CUSTOMER_NAME":"UG","ADDRESS_LINE_1":"RT","ADDRESS_LINE_2":"878","PRIVATE_NUMBER":"RF"},
{"CUSTOMER_ID":"789","CUSTOMER_NAME":"GV","ADDRESS_LINE_1":"ED","ADDRESS_LINE_2":"8989","PRIVATE_NUMBER":"FGG"}
]
Для добавления нового столбца модель должна иметь еще одно свойство, т.е. newCol
здесь
[
{ "CUSTOMER_ID": "200", "CUSTOMER_NAME": "RF", "ADDRESS_LINE_1": "CV", "ADDRESS_LINE_2": "5988", "PRIVATE_NUMBER": "YY", "EXT_FLDS": { "PRINTING_NUM": { "fieldvalue": 11, "fieldlabel": "Printing Number", "uictrl": "sap.m.Input" }, "COUNTRY": { "fieldvalue": "Thailand", "fieldlabel": "Country", "uictrl": "sap.m.ComboBox" } } },
{ "CUSTOMER_ID": "80", "CUSTOMER_NAME": "UG", "ADDRESS_LINE_1": "RT", "ADDRESS_LINE_2": "878", "PRIVATE_NUMBER": "RF", "EXT_FLDS": { "PRINTING_NUM": { "fieldvalue": 11, "fieldlabel": "Printing Number", "uictrl": "sap.m.Input" }, "COUNTRY": { "fieldvalue": "Thailand", "fieldlabel": "Country", "uictrl": "sap.m.ComboBox" } } },
{ "CUSTOMER_ID": "789", "CUSTOMER_NAME": "GV", "ADDRESS_LINE_1": "ED", "ADDRESS_LINE_2": "8989", "PRIVATE_NUMBER": "FGG", "EXT_FLDS": { "PRINTING_NUM": { "fieldvalue": 11, "fieldlabel": "Printing Number", "uictrl": "sap.m.Input" }, "COUNTRY": { "fieldvalue": "Thailand", "fieldlabel": "Country", "uictrl": "sap.m.ComboBox" } } }
]
Примечание. Предполагается, что * NewProperty
существует в модели привязки customerJSONData
.