Modifying appointment event from external using Javascript - fullcalendar

I am working ith Fullcalendar, and it is great. I now want to use SignalR to modify events in real time. For this i would need to modify a single event and render it.
In the API section it gives me the way for dealing with drag and drop. this and creating the schedules etc. have been working in my development since 4 years without issue.
Does anybody please have an idea or snippet how to initiate a call to modify/create/delete a calendar item from external (how to create an instance with which ID, server will not know the schedule ID, and just rerender this one instance which is shown in the API section)
thanxs
Walter

Related

Why GTM server container duplicates intercepted GA4 client events?

I have server-side tracking implemented using Google tag manager.
I noticed duplicate events coming in but not because my GTM web container sends duplicate events (verified in debugger).
The GA4 client in my GTM server container receives two identical event calls, for no obvious reason. The only difference is the param _s:
https://www.google-analytics.com/g/collect?[...]&_s=1
https://www.google-analytics.com/g/collect?[...]&_s=2
I've dealt with this by creating a query parameter variable:
And then excluding all calls where the _s param equals 2 from my GA4 event trigger:
This solves the issue but seems like a hacky solution.
I wonder why two identical server events get triggered in my GTM server container, for a single GTM web event, in the first place?
I had a similar problem, and I couldn't solve it by filtering the parameter because it happened later (I think the params of the two events were _s=6 and _s=7).
I started looking for blog posts until I've found this one: https://www.thyngster.com/google-analytics-4-events-demystified-ga4. The suggestion that helped me was this one:
You may see events being fired on the browser that you didn't define on Google Tag Manager or GTAG. This is normal, don't go crazy with it. If you see a duplicate event or a new event that you don't know where it's coming from take a look at the Data Stream Settings
And, in fact, inside Data Streams was the solution to my problem: under Events settings > Create Events, someone had created a custom event based on the same name as the one I was firing through code, in my case it was add_to_cart.
Disabling the custom event solved the issue.
EDIT
I forgot to mention that the first way of debugging this issue was to check the value of the dataLayer variable in the browser console. This variable keeps track of all the events, together with their send_to attribute. Before looking into the analytics dashboard you should check whether you are sending duplicate events from the code and whether you are firing other events with the same name but without the correct send_to attribute, which will result in two events with the same name firing to the stream you are tracking.

FullCalendar: is there still a viewRender event hook?

I need something like the viewRender event in order to persist the user's state. I'm building a UI where users will frequently jump in and out of the calendar, so preserving their view/range is essential for a pleasant experience. Does this exist in v5? The last mention I can find of it is from v3.
The only workaround I can think of right now is a direct click handler on every view control element, or a very heavy-handed MutationObserver. This is a React app so either one is going to be super awkward.
Thank you!
Edit 2021-02-11:
I looked at the available view render hooks but none of them address my problem. What I need is an event that will fire whenever the view state changes, including clicking between weeks/months/etc., so that I can persist the date range the user most recently viewed as well as the view they had selected.
viewDidMount is the closest to what I need, but it does not fire when the date range changes.
Edit 2021-05-26:
Another problem with using viewDidMount is that using it to enact side-effects is a bit overeager. The hook gets called whether or not the user has actually done anything, and the default view always gets passed as view inside the View Object. So there's no way to tell whether this mount event contains data I should persist or not.

FullCalendar event editable callback

I am implementing a FullCalendar Scheduler where the client can drag the events around the timeline.
When an event is dragged and dropped somewhere, an ajax call is made, where the backend perform some operations on the database, and possibly reverts the event if something went wrong.
What I want to achieve, is to block the event dragging possibility, while the backend script runs, so the users can not drag and drop anything until the backend code finishes. This could be easily achievable, by having a callback function for the event objects editable property where I check a global variable to determine if any event is in the upgrading process currently, or not, but unfortunatly, it seems that FullCalendar does not support this.
Do you know of any other solution to achieve my desired behaviour?
At the moment I am using FullCalendar V3, so I would prefer a solution to that version, but if an easy to implement solution shows itself with V4, I am willing to upgrade.

Automatic Save Throughout ASP.NET Application? [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
ASP.NET Forms autosave
I'm looking for general guidance on how to implement an "auto-save" feature in ASP.NET 4.0. I have an application with a tabbed interface (AJAX Control Toolkit) and a user can make changes in a variety of fields and tabs at any given time. I need to create an auto-save for (1) every time changes are made to fields and (2) save everything every 3 seconds (or what not).
I've never implemented something like this and I'm looking for guidance one it. Obviously, I'm assuming that there's some AJAX involved, I just don't know how to go about it.
Use a web service with ASP.NET AJAX:
http://msdn.microsoft.com/en-us/magazine/cc163499.aspx
http://www.asp.net/ajax/documentation/live/tutorials/ConsumingWebServicesWithAJAXTutorial.aspx
http://encosia.com/using-jquery-to-consume-aspnet-json-web-services/
You ship off the data to the server using a web service. You can attach to the change event of the input control (or lostfocus event too), and when it fires, call the web service. For the every X seconds, use window.setTimeout or window.setInterval, and make the call to send all the pages data to the server.
I don't know if it will perform well by sending data that frequently; are you sure you need to do both?
An easy way would be to
Wrap autocomplete form in update panel
Attache .change() listeners to all textboxes ect
Add a javascript timer to the page
In the change event and timer click hidden button to post form back.
Maybe have some cute page has been saved text you update during the postback
Bam all done

What is the right way to handle mode parameters in MVC?

My app has a number of ambient properties, like the current CountryId, DocumentMode, etc. As I learned in a previous question, the current value of these properties should not be stored in the Session, but rather sent in the query string on every page request. So far so good.
So when I build a page, I want to arrange that all the action links look like this:
/controller/action?CountryId=x&DocumentMode=y&...
I can easily do this by checking the query string and slipping in the current value of each of these variables.
The question is, what's the right way to notify the app when one of the values changes?
Specifically, at the top of each view, I have a select dropdown that shows, e.g., all the countries. What should happen when you select a new one?
Right now, the change triggers a javascript function call that replaces the CountryId in the query string, and calls an action that just reloads the original page, but with the new CountryId set, and so the new action links are rebuilt. But this seems sort of kludgy. Is there a more elegant way to just update all the links on the page without needing a server refresh to do this? (I could always cook up some script to do this, but it doesn't seem trivial, and I don't want to reinvent the wheel if there's a built in way to do this.)
Any help much appreciated. Thanks!
You could put the part of the page that changes in a partial view and reload that view via AJAX each time a control is changed.
Partial rendering after page loaded
Alternatively you could just write some javascript to update all the links. Post some code and I'm sure you'll get some suggestions on a good way to write it.
I decided to keep things simple for the time being and just refresh the whole page, which recreates all of the links. My app is low volume and this suffices for now. If I ever need to build an app where the server can't be foolishly stressed like that, I'll see about the swap-in-place solution.

Resources