Javascript 扩展sap.ui.unified.calendar约会
我当前正在尝试扩展日历约会(计划日历)。我现在很困,我可以用一些技巧让我重新上路 我正在尝试将字符串属性“project”添加到日历约会。下面的代码是我到目前为止的代码 XML 这就是我现在正在使用的XMLJavascript 扩展sap.ui.unified.calendar约会,javascript,sapui5,Javascript,Sapui5,我当前正在尝试扩展日历约会(计划日历)。我现在很困,我可以用一些技巧让我重新上路 我正在尝试将字符串属性“project”添加到日历约会。下面的代码是我到目前为止的代码 XML 这就是我现在正在使用的XML <mvc:View controllerName="be.amistaplanningadmintool.controller.Board" xmlns:mvc="sap.ui.core.mvc" xmlns:unified="sap.ui.unified"
<mvc:View
controllerName="be.amistaplanningadmintool.controller.Board"
xmlns:mvc="sap.ui.core.mvc"
xmlns:unified="sap.ui.unified"
xmlns:custom="be.amistaplanningadmintool.controls"
xmlns="sap.m">
<VBox class="sapUiSmallMargin">
<PlanningCalendar
id="PC1"
startDate="{path: '/startDate'}"
rows="{path: '/people'}"
appointmentsVisualization="Filled"
appointmentSelect="handleAppointmentSelect"
showEmptyIntervalHeaders="false">
<toolbarContent>
<Title text="Title" titleStyle="H4"/>
</toolbarContent>
<rows>
<PlanningCalendarRow
icon="{pic}"
title="{name}"
text="{role}"
appointments="{path : 'appointments', templateShareable: 'true'}"
intervalHeaders="{path: 'headers', templateShareable: 'true'}">
<appointments>
<custom:CalendarAppointment
startDate="{start}"
endDate="{end}"
icon="{pic}"
title="{title}"
text="{info}"
type="{type}"
tentative="{tentative}"
project="{project}">
</custom:CalendarAppointment>
</appointments>
<intervalHeaders>
<unified:CalendarAppointment
startDate="{start}"
endDate="{end}"
icon="{pic}"
title="{title}"
type="{type}">
</unified:CalendarAppointment>
</intervalHeaders>
</PlanningCalendarRow>
</rows>
</PlanningCalendar>
</VBox>
</mvc:View>
控制
这是我用来尝试扩展当前控件的控件
sap.ui.define(
["sap/ui/unified/CalendarAppointment"],
function(CalendarAppointment) {
return CalendarAppointment.extend("be.amistaplanningadmintool.controls.CalendarAppointment",{
metadata: {
properties: {
project: "string"
}
},
renderer: function(oRm, oControl){
sap.ui.unified.CalendarAppointmentRenderer.render(oRm, oControl); //use supercass renderer routine
}
});
}
);
如有任何建议或提示,将不胜感激
谢谢
David以错误的方式引入了“项目”属性。没有“可编辑”这样的东西。阅读文档
关于自定义控件也很好。感谢您的输入,Andrii。你认为我可以添加一个新字符串而不需要添加一些自定义HTML吗?
sap.ui.define(
["sap/ui/unified/CalendarAppointment"],
function(CalendarAppointment) {
return CalendarAppointment.extend("be.amistaplanningadmintool.controls.CalendarAppointment",{
metadata: {
properties: {
project: "string"
}
},
renderer: function(oRm, oControl){
sap.ui.unified.CalendarAppointmentRenderer.render(oRm, oControl); //use supercass renderer routine
}
});
}
);