search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to create and edit events in ionic v1

Asked by Anonymous
3 years ago.

The version I am using for my mobile is DayPilot Pro for JavaScript 2020.3.4610 (trial).

I was trying to create an event with a dropdown and ionic datepicker. But dropdown values are not getting binded. ionic datepicker is not even appearing.
I tried to show the view on creating an event by using daypilot modal.

I would also like to know how to close the modal while saving the event. I tried to close the modal while saving the event. But that also doesn't work. Given below is the code for the modal that I wrote.

var modal = new DayPilot.Modal({
saveEvent: function (args) {
console.log("Modal dialog closing");
modal.close();
},
onClosed: function (args) {
console.log("Modal dialog closed");
},
});
modal.showHtml("<div><h1>Create Event</h1><form><div><select ng-model='assignmentKey' ng-options='x.new for x in assignmentList | unique:'new'' ng-value='x.newKey'><option label=' Select '></option></select></div><div><button click='saveEvent()'>Save</button></div></form></div>");

Hope I will get a reply asap. Thanks in advance.

Answer posted by Dan Letecky [DayPilot]
3 years ago.

DayPilot.Modal just shows the supplied HTML and it doesn't perform any framework-specific initialization.

You can supply an element instead of HTML when calling showHtml(), or you can initialize the content manually in onShow() event but I recommend using a modal dialog created using DayPilot.Modal.form():

https://code.daypilot.org/60913/javascript-scheduler-edit-multiple-fields-modal-dialog
https://api.daypilot.org/daypilot-modal-form/

Comment posted by unknown
3 years ago.

I tried using DayPilot.Modal.form() as mentioned in the links provided. But I am not able to create a dropdown using form or binding a list of values coming from the database for the dropdown. Can anyone help me with that ?

ionic v1 is used for developing the app.

Thanks in advance.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.