Hi, i have used popupopen event to customise editor window (as i am using a very old version of react and editor template isn't working for that version), but there is some issue due to which the fields are not initialized to proper values when the component is mounted first, after that it works fine.
I have uploaded the code here https://bitbucket.org/lakshay_25/syncfusion-schedule-edit-window/src/master/
Any help on this will be highly appreciated plus please let me know how i can initialise start and end date for new events.
Thanks.
Hi Louie,
We have validated your query “let me know how I can initialize start and end date for new events” at our end. You can resolve the problem by setting up the value to the value property of the start and end date pickers as shown in the below code snippet.
[EventCalendar.jsx]
|
onPopupOpen(args) { if (args.type === "Editor") { //Adding From and To Date components if (!args.element.querySelector(".custom-field-row-1")) { let startDate = new DatePicker( { placeholder: "From", value: args.data.startTime, renderDayCell: this.onRenderCell, }, startElement ); startDate.appendTo(inputEle1); } if (editorHeading !== "Edit Event") { if (!args.element.querySelector(".custom-field-container-2")) { let endDate = new DatePicker( { placeholder: "To", value: args.data.endTime, renderDayCell: this.onRenderCell }, endElement ); } } } |
Kindly let us know if you need any further assistance.
Regards,
Ravikumar Venkatesan
Hi, Thank you for getting back to me, this works only when the page is loaded for the first time and i select a cell to create new event, as soon as i click on another cell, start date and end date are initialised with current date only and not with the date of that cell.
I have updated the code with your suggested solution, but it didn't work out. Please find the updated code at => https://bitbucket.org/lakshay_25/syncfusion-schedule-edit-window/src/master/ .
Any help on this will be much appreciated.
Thanks
Hi @Ravikumar Venkatesan, thankyou for looking into the issue, but you can consider this as closed.
I was able to figure out this and now i am able to initialize start and end dates with correct values.
Thanks.
Hi Louie,
Thanks for the update.
We are happy that your problem has been resolved now.
Regards,
Satheesh Kumar B