SAPUI5-使用_每个循环呈现内容时出现问题
我有一个包含子问题输入框的面板类别 面板显示良好,但每个面板内容:属性可以包含多个问题SAPUI5-使用_每个循环呈现内容时出现问题,sapui5,Sapui5,我有一个包含子问题输入框的面板类别 面板显示良好,但每个面板内容:属性可以包含多个问题 var oPanel = new sap.m.Panel({ expandable: true, expanded: false, headerText: oData.results[0].CategoryDesc, id: "Panel" + index, content: _.each(
var oPanel = new sap.m.Panel({
expandable: true,
expanded: false,
headerText: oData.results[0].CategoryDesc,
id: "Panel" + index,
content: _.each(oViewData.categories, function(result, index2) {
new sap.m.Input("iCategory" + index + index2, {
});
})
});
oPanel.placeAt("panelContent");
我正在很好地检索数据,但内容无法呈现。我收到了错误消息:
The renderer for class sap.ui.core.Control is not defined or does not define a render function! Rendering of __control0 will be skipped! -
是否可以在content属性中使用_each下划线?如果没有,我的备选方案是什么?您可以将数据推送到数组中,并在内容区域中使用它:
var oPanelContent = [];
_.each(oViewData.categories, function(result, index2) {
oPanelContent.push(new sap.m.Input("iCategory" + index + index2, {
})
);
var oPanel = new sap.m.Panel({
expandable: true,
expanded: false,
headerText: oData.results[0].CategoryDesc,
id: "Panel" + index,
content: oPanelContent
})
});
oPanel.placeAt("panelContent");
使用addContent解决: