|
|
When various operations are performed on a scheduler control they
generate events sent to a server using callback or postback.
Perform various operations on a scheduler or doubleclick any
element of a control:
Server events |
An example demonstrates a wide range of server events
allowing to program a scheduler using server code.
Calling server events is fully configurable and setting a way
particular events will be called is possible using EventXxxx properties.
Most important setting is a UseCallback property.
Its default value is true meaning callback is used.
Such calls are made in a background and do not require reading a
whole HTML page by a browser.
Therefore a screen does not flicker, values entered in fields are not
lost and cursor position does not change.
Such calls are also much faster as amount of data exchanged between a
server and a client is much smaller.
However, if you want to use postback, it is also possible.
Then a UseCallback property should be set to false.
For example a EventItemTextEdited.UseCallback property determines
how an event called when text is accepted works.
A EventItemDragged.UseCallback property determines how to handle an
event called after a SchedulerItem object is moved.
Apart from events informing particular tasks are performed on a control,
you can also implement server events handling mouse operation on particular areas.
DefaultItemStyle, CaptionStyle, TimeLineStyle
properties allow to configure a way different areas of a control look like.
There is also a possibility to define postback or callback server mouse event.
A XxxStyle property contains EventXxx properties, allowing to
handle mouse events such as Click, DblClick, MouseDown,
MouseUp, MouseMove, MouseOver, ContextMenu.
Ex. a Sch.CaptionStyle.EventClick event is called when a mouse is
clicked on a title of a scheduler while Sch.BodyStyle.EventContextMenu
event before a context menu is opened on a main grid of a scheduler.
Setting a Sch.BodyStyle.EventClick.Mode property to Callback
causes calling a server event in a callback mode.
Setting it to Postback will call an event in postback mode.
These mechanisms allow to fully program a control behavior on a server.
An example on this page shows which server events are called.
Code adding information about events called to infos list was added to all server events.
Some parameters these events are called with are also added to this array.
All events are called in callback mode.
Then before server events are handled, the last GoControl.CallbackScript
event is called. It can be used to prepare JavaScript code on a
server and run it in a browser after an event is handled on a server.
A code is created initializing a string that will be assigned to
a InfoLabel object created using log server events.
A DHTML innerHTML property is used for this purpose and
contents of a log will be
displayed in a browser.
If you would look into a
source code
for this demo, click on the link.
For demonstration purposes all appointments displayed on a calendar are stored in
ASP.NET session objects, so original values are restored immediately after a new
session object is created.
A list of appointments and resources is intialized every time a new session is started.
|