- Home
- Forum
- ASP.NET MVC
- Modal appointment on cell click
Modal appointment on cell click
I' would like display directly the modal windows (see attach file) with the event "cellClick"
without display the popup . Is it possible ?
Thank you,
Nicolas
(sorry for my bad english)
Attachment: Capture_fbe4769c.zip
Thanks for contacting Syncfusion support.
We have prepared a schedule sample to meet your requirement (Open detailed window on cell click) which can be downloaded from the following location.
http://www.syncfusion.com/downloads/support/forum/120775/ze/CellClick473840419
In the above sample we have used the following code example to open the detailed window when we click on the cell.
<code>
@(Html.EJ().Schedule("Schedule1")
.Width("100%")
.Height("525px")
.ScheduleClientSideEvents(eve => eve.CellClick("OnCellClick").AppointmentClick("OnCellClick")) //If you want to open the appointment detail on single click bind the same method name for appointment click and use the below code example
.AppointmentSettings(
fields => fields.Datasource(Model)
----------------
)
<script type="text/javascript">
function OnCellClick(args) {
args.cancel = true; //Block the quick window open.
if (args.type == "cellClick")
this._appointmentWindow({ target: args.target.currentTarget }); //Open the detailed window with updated date and time.
else if(args.type=="appointmentClick")
this._appointmentWindow({ target: $("#Appointment_"+args.appointment.Id) }); //If you want to open the appointment detailed window use this code.
}
</script>
</code>
Regards,
Sarath Kumar P K
It's possible to use the method _appointmentWindow(e) to create an Open detailed window just by clicking on a button (without cell click or dblclick) ?
For example:
<code>
<button onclick='openWindow'>Open detailed window</button>
...
<script>
function openWindow(){
var schedule = $("#Schedule1").data("ejSchedule");
schedule._appointmentWindow(???);
};
</script>
</code>
We have analyzed the scenario to open the appointment detailed window using default button click. It is possible to open the detailed window but you need to pass the schedule work cell DOM element as a parameter and also you need to call “_cellSelection” method so that the required values are updated properly in appointment window and you can save the appointment. While using this customize window open action using button click, no need to bind the client side events “cellClick and appointmentClick”. Please refer to the following code example:
<code>
<button onclick='openWindow()'>Open detailed window</button> //Create button to trigger the openWindow method
<script type="text/javascript">
function openWindow() {
var schedule = $("#Schedule1").data("ejSchedule");
schedule._cellSelection({ target: $(schedule.element.find(".e-workcells")[0]) }); //Call the _cellSelection method to get the required data based on target cell
schedule._appointmentWindow({ target: $(schedule.element.find(".e-workcells")[0]) }); //Here you need to pass the schedule cell target element, I have passed the first schedule work cells. If you want to open the window in month view replace the class “.e-workcells” by “.e-monthcells”.
}
</script>
</code>
Regards,
Sarath Kumar P K
We are glad to hear that the provided solution resolved your requirement.
Please let us know, if you require any further assistance. As always, we will be happy to assist you.
Regards,
Sarath Kumar P K
Thank you very much.
Nicolas
Thanks for the update.
Regards,
Sarath Kumar P K
- 8 Replies
- 2 Participants
-
ES ESTEBE
- Oct 14, 2015 07:39 AM UTC
- Oct 20, 2015 04:17 AM UTC