javascript - Extending sap.m.PlanningCalendar -
i wondering if me out extending planning calendar. want extend 1 of parameters called calendar appointment (sap.ui.unified). currently, has few properties title, text, icon etc. want extend has 'project' property.
this have far xml:
<mvc:view controllername="amista_planningboard.controller.calendar" xmlns:mvc="sap.ui.core.mvc" xmlns:unified="sap.ui.unified" xmlns="sap.m" xmlns:custom="amista_planningboard.controls"> <vbox class="sapuismallmargin"> <planningcalendar id="pc1" startdate="{path: '/startdate'}" rows="{path: '/people'}" appointmentsvisualization="filled" appointmentselect="handleappointmentselect" showemptyintervalheaders="false" intervalselect="handleappointmentaddwithcontext"> <toolbarcontent> <title text="amista - planning board" titlestyle="h4"/> <toolbarspacer/> <button id="addbutton" icon="sap-icon://add" press="handleappointmentcreate" tooltip="add"/> </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> <calendarappointment startdate="{start}" enddate="{end}" icon="{pic}" title="{title}" type="{type}"></calendarappointment> </intervalheaders> </planningcalendarrow> </rows> </planningcalendar> </vbox> </mvc:view>
this extended control:
sap.ui.define( ["sap/m/planningcalendar"], function(calendarappointment) { return calendarappointment.extend("amista_planningboard.controls.calendarappointment", { metadata: { properties: { project: "string" } }, renderer: function(orm, ocontrol) { sap.m.planningcalendarrenderer.render(orm, ocontrol); //use supercass renderer routine } }); }
);
can send me right direction or give me useful tips/suggestions?
thank much.
kind regards matthijs
if need help, need add code have tried far. otherwise not answer.
anyhow give hint.
create 1 file in name of mycalendarappointment in project , add below code.
sap.ui.define(["sap/ui/unified/calendarappointment"], function (calendarappointment) { "use strict"; return calendarappointment.extend("my.project.path.mycalendarappointment", { metadata: { properties : { project : "string", } }, init: function () { calendarappointment.prototype.init.apply(this, arguments); } }); });
and in xml view
<namespacewithfilepath:calendarappointment startdate="{start}" enddate="{end}" icon="{pic}" title="{title}" text="{info}" type="{type}" tentative="{tentative}" project="{project}"> </namespacewithfilepath:calendarappointment>
here namespacewithfilepath important , custom calendarappointment present.
Comments
Post a Comment