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.
Related
I've faced to problem. Fullcalendar has property eventClick which allows you to handle a click on an event from list events calendar. Now I've started use fullcalendar scheduler (#5.7.0) where I need to click and call such action but on resource, from list resources in the left side. I've couldn't find any solutions so decided to write feature request. If solvetion has already existed, couldn't you share information and write to way to use resourceClick in fullcalendar scheduler #5.7.0.
I think it featuer will be usefule for many projects, where use resource timeline.
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.
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
I have to build a site like an auction-site:
I Have a detail page from items where a countdown should run down.
In this page nearly every second a update must be possible without a postback for the user:
coundown must be reset
money of aucton must be updated
gridView with last bidders must be updated
What kind of timer should I use for the countdown?
How can I update every second from DB? ( Ajax? )
How can I update the values / gridView?
You can use an UpdatePanel with Ajax.
However, given the nature of "Internet weather," one second per update is pretty aggressive for that approach.
You might instead consider using Silverlight. You would have much more control that way, and could minimize the amount of data that needs to go over the wire. In fact, you could use long polling with raw TCP connections, to further increase scalability.
For the countdown, you can use the JavaScript timing events. To access the database, if you don't want postback then you indeed need to access the data service by using Ajax. To make things easier, I recommend that you take a look at any Javascript libary such as JQuery.
For the timer I would use Threading.Timer so this can count down uninterrupted in a separate thread. You could also use a TimerCallback delegate which would do the database processing. However, I would be wary about trying to query the database at such a rate.
I would advise you look at using Ajax Update Panel for updating the countdown section of the page alone so you don't have to refresh the entire page.
On a rather complicated screen with a big updatepanel, I'm running into the following problem:
If a user clicks on a certain button 6 or 7 times really fast, it seems to eventually process the last request out of turn and problems occur. Specifically, there's an xml document in session state, and it gets out of sync.
What I really want to do is block clicks to this button until the postback completes. I know I could probably find an easy way to do this with Javascript, but it seems like it might be built-in.
Any thoughts?
Note: The answers below are helpful, but they haven't solved the problem. After disabling the linkbutton with onClientClick and then allowing it to come back after the postback enabled again, the problem persists. It's almost as if the updatepanel isn't quite done with everything even though it has drawn the fresh, enabled linkbutton on the screen.
More notes (solved!): I solved this one by using BlockUI (jQuery plugin). See my answer below.
ASP.NET UpdatePanel always honors the last request. If you make a request while one is processing, the first requests gets terminated and the current one is processed. It was designed and built to work this way.
I would disable the button with JavaScript once it has been clicked.
UpdatePanel? I will assume you are using MS AJAX, if so I will recommend you download the AJAX toolkit if you have not done so. This toolkit comes with many ready to use controls, and extensions to help you in your AJAX enabled app. For example, there is one extension called "ConfirmButton" that will help you prevent the user from clicking in a button more than once, and it also does it in a very cool and elegant manner.
Another option will be to use JavaScript or better yet, create a custom button control that has a property to be disabled after it is clicked, if you do that, it will be really easy to reuse it in your other applications.
Hope this helps.
In a home-rolled AJAX framework I worked on awhile back, we simply logged the last call in javascript (javascript function call with many parameters) and prevented subsequent calls with identical parameters. It wasn't ideal, but it did the trick in a pinch.
I was having some "Asyc" problems with infragistics control, but after adding ScriptMode="Release" in Scripmanager the problem was resolve.
The link below solved my problem in about half an hour. Just going with a javascript disable (and I tried several different ways...) did not do the trick due to the timing of the updatepanel.
Disabling UpdatePanels While an Asynchronous Postback is in Progress