RadScheduler refresh rate

Currently I am incorporating RadScheduler into my project. The scheduler requires a regular update, so I have implemented a JavaScript function with an interval to call rebind() on the RadScheduler every 60 seconds. However, an issue arises when the user opens the advanced form as the rebind() method causes the form to disappear. Is there a way to detect the opening and closing events of the AdvancedForm in order to manage the timer accordingly?

Your assistance is greatly appreciated.

Answer №1

RadScheduler has an event for when its Edit form opens, called OnClientFormCreated, but there isn't one for when the form closes. However, with some additional code, you can achieve this.

There are various actions that can lead to the form closing - the user clicking on the close icon, pressing cancel, or saving.

You can refer to this demo to see the Advanced Edit Form in action and find pre-written JavaScript code.

In the schedulerFormCreated() function, you can handle these actions as follows:

function schedulerFormCreated(scheduler, eventArgs) {
    var mode = eventArgs.get_mode();
    if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert ||
        mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
            var formElement = eventArgs.get_formElement();

            var cancelButton = $("[id$='_CancelButton']");
            cancelButton.on("click", formClosed);

            var templateKey = scheduler.get_id() + "_" + mode;
             ....

And a separate event for form closure can be defined as:

function formClosed(eventArgs) {
}

In the formClosed function, you can implement logic for resuming operations, while in schedulerFormCreated, call the function that stops operations after the if-statement.

To target the save button, use _UpdateButton, and for the close icon, it is _AdvancedEditCloseButton. Ensure specificity in element selection by inspecting with tools like FireBug or Chrome Dev tools.

This approach should help achieve the desired functionality.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Text field value dynamically changes on key press update

I am currently working on the following code snippet: {% for item in app.session.get('aBasket') %} <input id="product_quantity_{{ item['product_id'] }}" class="form-control quantity" type="text" value="{{ item['product_quan ...

Error encountered while installing Material UI in Next.js with TypeScript and pure JavaScript configurations

I'm brand new to React and Next.js, so please forgive me for asking what may seem like a silly question. I'm attempting to install Material UI in a fresh Next.js application that I created using "npx create-next-app@latest". I've been refere ...

Is it possible to incorporate an element using absolute positioning using jQuery or Javascript?

When trying to add a new element on the screen, I am facing an issue with the absolute positioning not working properly. Sample Code in Javascript function drawElement(e,name){ $("#canvas").append("<div id='" + name + "' class='e ...

Encountering a CORS issue specifically on the client side of a Next.js application when interacting with an API gateway

I've been struggling with this issue for a week now and can't seem to fully describe it. I have a FastAPI server running as a Lambda connected to API Gateway. https://i.stack.imgur.com/S5Zx9.png Both FastAPI and API Gateway have CORS enabled, b ...

What is the best way to manage the maximum number of concurrent AJAX requests?

I am currently working on an autocomplete search bar feature. <input type="text" class="form-control" id="text" > <script> $("input").keyup(function(){ let key = $("input").val(); ...

Troubleshooting a timing loop problem with jQuery Ajax and setInterval when using flipCounter's onAnimationStopped feature

In the code below, I am retrieving some data to use for a counter. The problem is that after the initial page load and one interval, things start to go haywire. The calls are made without any delay and the counter cannot react before the next call is made. ...

Could this be a problem within my recursive function?

Struggling to iterate through a stack of HTML Elements, I attempted to write a recursive function with no success. In the code snippet below, I'm facing challenges in returning a value from an if statement and ultimately from the function itself. Wh ...

What is the best way to check for date equality in Node.js?

I am dealing with this code condition: stopped_at: { $lte: new Date(Date.now() - 86400 * 1000) } The above code successfully retrieves dates that are less than or equal to 24 hours ago. However, I am wondering if there is a simpler solution a ...

Every time I attempt to send a post request, I receive back only the creation date and the unique objectID

Whenever I send a post request, only the created date and objectID are returned. Whenever I send a post request, only the created date and objectID are returned. This issue persists even after multiple attempts. I attempted to verify it using Postman ...

Issue with VueJS where changes made to properties in the mounted hook do not properly trigger the

I'm working on a VueJS component that features a button with computed properties for its class and text. These properties change every time the button is clicked, updating smoothly with each interaction. However, I've encountered an issue when at ...

Guide on dynamically generating checkboxes within cells of a table using ASP.NET and C#

Currently, I am utilizing asp.net with c# to dynamically create checkboxes from the code and then add them to my webpage. Below is the snippet of my c# code in the aspx.cs file: public String getSubjects() { SqlConnection conn = new DB_Connection().ge ...

Is it possible to retrieve data from Local Storage using user_id and SessionId, and if so, how can it be done?

I have some data in an interactive menu created with iSpring, which includes a feature for local storage to save the last viewed page. I also have a system for logging and need to associate this local storage with user_id or sessionid. I found some informa ...

Is relying on getState in Redux considered clunky or ineffective?

Imagine a scenario where the global store contains numerous entities. Oranges Markets Sodas If you want to create a function called getOrangeSodaPrice, there are multiple ways to achieve this: Using parameters function getOrangeSodaPrice(oranges, s ...

Inability to load a MySQL table using Ajax on the same webpage

I'm facing an issue where I want to load a table from mySql on the same page without getting redirected to another page. The user selects a date range, and upon pressing submit, it should appear in the designated div id tag. However, the functionality ...

AngularJS Custom Navigation based on User Roles

I am currently developing a small web application using angular. My goal is to implement role-based navigation in the app. However, I am facing an issue where the isAdmin function does not seem to be getting called on page load, resulting in only the foo a ...

Access Sharepoint from an external site

Looking for assistance with a SharePoint list containing columns for Name, Position, Office, and Salary. Upon logging in with specific credentials to the SharePoint website, I need to retrieve all items from the list and showcase them on my own website. ...

Having difficulty initializing jQuery DataTables upon button click with an Ajax request

I have a piece of HTML code that represents a partial view: <table id="table_id" class="table table-inverse"> <thead class="thead-inverse"> <tr> <th>Select</th> ...

Understanding the variations in behavior of the history.go(-1) method across various browsers

Is history.go(-1); consistent across all browsers? I've noticed different behaviors on various browsers. In my code, I have a line similar to javascript:history.go(-1); On the first page, there are three checkboxes. Users can only select two of them ...

How to implement ASP.NET Web Forms jQuery Update Progress without relying on ASP.NET Update Panel or Script Manager

When the submit button is clicked on my contact page, I want to display an update progress on the form without using Asp.net update panel or script manager. Is there a way to achieve this? I have found that using update panel and script manager adds an ad ...

AngularJS promises are known for returning the object itself instead of just the resolved value

function getBusTimetable() { var waiting = $q.defer(); var busData = $http.get('https://bus.data.je/latest'); busData.success(function(response) { waiting.resolve(response); }); busData.error(function(error) { waiting.reject( ...