а

Getting event data from "dhx_save_btn" function


#1

Hi I am trying to query the database to determine if this new event should be saved. I think I am in the right spot in the dhtmlxscheduler.js.

so in the code below I am getting event data, but the data I think is original settings and not the user selected data before clicking the save button. What object would I use to get the current data in the sections?

e.g.
vars.start_date has a date of - Mon Apr 22 2019 07:30:00 GMT-0400 (Eastern Daylight Time)
I am expecting this - Mon Apr 22 2019 13:00:00 GMT-0400 (Eastern Daylight Time)

thanks for any help!

var i = scheduler._getClassName(t);
if (t && i)
switch (i) {
case “dhx_save_btn”:

          let vars = scheduler._lame_copy(scheduler.getEvent(scheduler._lightbox_id));

          let startDate = vars.start_date;
          let endDate = vars.end_date;

#2

Hi, @RonM

There is only one way to get the current data in the sections of the lightbox - get access to the element by using, for example, querySelector() and then get its value manually.


#3

Hi Polina, Thanks for the response.

do you have example code on using the querySelector()? Sorry I am very much a novice with web programming and am having trouble figuring this out.

Thanks!


#4

Please check more details and the example:
https://www.w3schools.com/jsref/met_document_queryselector.asp
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_document_queryselector_class


#5

Thank you for the reply I will check out the examples you listed.

Is using “scheduler.formSection(‘time’).getValue();” an option?


#6

Yes, you can use the snippet system to check http://snippet.dhtmlx.com/945e6b546