Plugin handling Fullcalendar Callback "dateClick"


#1

Hi. I need help in writing my fullcaledar plugin call-back “dateClick”

The code in react that works =

42

particularly the line

57

which calls a popup “confirm” that creates a new event.

26

If I can replicate this implementation in the plugin–
then I will convert this “handle dateClick code” to call a component Block {classNameForComponentByName(compName)} created in ReactStudio {getCallBackForInteractEvent(interactId) } to get real info from data sheets (and save to data sheet “events”.

Your assistance is truly appreciated.
Steve


#2

Hi Steve,

you could probably implement something like this:

this.getReactWebJSXCode = function(exporter) {
	var jsx = `<div onClick={${exporter.getCallbackForInteractEvent("valueChange")}}>Test</div>`;
  return jsx;
}

this.reactWebInteractEventsForStudioUI = [
  "valueChange"
];

this.describeReactWebInteractEvent = function (exporter, eventName) {
  if (eventName == "valueChange") {
    return {
      "actionMethod": {
        "arguments": ["ev"],
        "getDataExpression": "\"test\""
      }
    };
  }
}

But the functionality would limited to the use of data slots (you can use value transformer script with the interaction though to implement any kind of custom code you like).

Another option could be probably to implement the method inline in the JSX code like this:

...
    dateClick={
      var timeDiff = 25
      var oldDt = new Date(arg.dateStr)
      var dtEnd = new Date(oldDt.getTime() + timeDiff*60000)
      ...
    }
...

And use that together with data sheet-picker in inspector UI (among other setting if needed).

Unfortunately I don’t have a good example so these are just vague ideas of the possible options that could work (or not).


#3

Thanks for the info

Appreciate your input
Steve