Giter Site home page Giter Site logo

scheduler-how-to-customize-the-go-to-date-dialog-e4015's Introduction

Files to look at:

Scheduler - How to customize the Go to Date dialog

This sample project illustrates how you can invoke a custom form instead of the standard Go to Date dialog and implement the functionality that enables the end-user to navigate dates using the custom form.
The technique utilized in this example is briefly explained below.

Let's start with the custom form.
The custom form consists of a single Calendar control. Its settings are specified via the CalendarSettings properties.
The SchedulerSettings.OptionsForms.SetGotoDateFormTemplateContent method is used to include a rendered custom form into the SchedulerPartial view.
To handle date selection within the Calendar control, we subscribe to the corresponding client-side event using the CalendarClientSideEvents.SelectionChanged property.
The event handler toggles the value of the boolean gotoDateCallback variable that indicates whether a special processing is required on a scheduler callback. Then the client-side ASPxClientScheduler.GoToDateFormApply method is called that initiates a callback to pass form data to the server control.
To handle a scheduler callback, we subscribe to the BeginCallback client-side event of the Scheduler. The SchedulerSettings.ClientSideEvents.BeginCallback property specifies the name of the handler function.
If the gotoDateCallback indicator is turned on, the function obtains new date from the calendar located in the custom form and passes it on to the callee.
To handle this request properly, we need a specialized callback command. We inherit this command from the DevExpress.Web.ASPxScheduler.Internal.GotoDateFormCallbackCommand class and override its ParseParameters and ExecuteCore methods. To register this command so it is executed instead of the default GotoDateFormCallbackCommand, the SchedulerSettings.BeforeExecuteCallbackCommand property is used. It specifies a custom handler that switches command execution when the command with the SchedulerCallbackCommandId.GotoDateForm identifier is queried for execution.
Finally, within the ExecuteCore method of a custom MVCxSchedulerGotoDateFormCallbackCommand command, methods of the IDateTimeNavigationService interface are called to perform date navigation within the scheduler.

When the application runs, select the Go to Date in the context menu. The result is shown in the picture below.


scheduler-how-to-customize-the-go-to-date-dialog-e4015's People

Contributors

devexpressexamplebot avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.