Working with Client-Side Events
C1Splitter includes several client-side events that allow you to manipulate the embedded items in the panels of the splitter control when an action such as sizing, collapsing, and expanding occurs.
By using client-side code such as JavaScript you can implement many features to your Web page without the need to send information to the Web server, which takes time. Thus, using client-side code can increase the efficiency of your Web site.
The following table lists the events that you can use in your client scripts. These properties are defined on the server side, but the actual events or the name you declare for each JavaScript function are defined on the client side.
Property |
Description |
Gets or sets the JavaScript function name that would be called at client side when starting to drag the splitter. | |
Gets or sets the JavaScript function name that would be called at client side when completing a drag operation on the splitter. | |
Gets or sets the JavaScript function name that would be called at client side when dragging the splitter. | |
Gets or sets the JavaScript function name that would be called before Panel1 is collapsed. | |
Gets or sets the JavaScript function name that would be called when Panel1 is collapsed by clicking the collapse/expand image. | |
Gets or sets the JavaScript function name that would be called before Panel1 is expanded out. | |
Gets or sets the JavaScript function name that would be called when Panel1 is expanded out by clicking the collapse/expand image. |
These events are useful for providing client-side interactivity. With these events you can provide more control over C1Splitter by controlling how the users interact with C1Splitter. For example you can restrict sizing of the panels, collapsing, or expanding on the client side.
To process these events, you must add JavaScript functions to your Web form's source page, then have the control call these functions in response to the C1Splitter client-side events. Each of the client-side events requires two parameters: the ID that identifies the sender C1Splitter and an eventArgs that contains the data of the event.
You can use the server-side properties, listed in the preceding table, to specify the name of the JavaScript function that will respond to a particular client-side event. For example, to assign a JavaScript function called "ClientSizing" to respond to the mouse dragging the splitter bar, you would set the OnClientSizing property to "ClientSizing".
|