This topic explains, with a code examples, how to attach event handlers to the igSplitter
™ control.
The following topics are prerequisites to understanding this topic:
igSplitter Overview: This topic provides conceptual information about the igSplitter
control including its features and user functionality.
Adding igSplitter: This topic demonstrates, with code examples, how to add the igSplitter
control to an HTML page in either JavaScript and ASP.NET MVC.
This topic contains the following sections:
Attaching event handler functions to the igSplitter
control is commonly done upon the initialization of the control. When the event occurs, the handling function is called.
When using the Ignite UI for MVC, it is necessary to assign event handlers at run-time because you cannot define event handlers within the HTML helper.
jQuery supports the following methods for assigning event handlers:
From these, the delegate() method is the recommended one because it offers the best performance and allows the event handler to be automatically re-attached if the control instance is destroyed and then re-created.
The igSplitter
supports the following events:
The following table explains briefly the event handling cases related the igSplitter
. Further details are available after the table.
Event handling case | Details |
---|---|
Handling events upon initialization in jQuery |
When binding to events on widget initialization, you subscribe to the event using an option which in the following format:
eventName : eventName option are:
|
Handling events at run-time in jQuery and ASP.NET MVC | You can assing the event handler to the name of a function in order to implement the handler outside control initialization. |
The following table lists the code examples included in this topic.
Example | Description |
---|---|
Handling the resizeStarted Event Upon Initialization in jQuery | An example of assigning event handling function to the resizeStarted event at initialization. |
Handling the resizeStarted Event at Run-Time in ASP.NET MVC | The code in this example assigns an event handler at run-time. |
This example assigns an event handling function to the resizeStarted
event at initialization.
In JavaScript:
$(".selector").igSplitter({
resizeStarted: function(evt, ui) {
// Handle event
}
});
This example assigns an event handler for the resizeStarted
event at run-time.
In JavaScript:
$(document).delegate(".selector", "igsplitterresizestarted", function(evt, ui) {
// Handle event
});
The following samples provide additional information related to this topic.
Basic Vertical Splitter: This sample demonstrates how to use the Splitter control to manage a page's vertical layout. The first container contains a Tree control with continents and countries. The left vertical panel has maximum and minimum ranges that a user can resize the panel. When a node is clicked, the description for the selected item is in the right panel.
Basic Horizontal Splitter: This sample demonstrates how to use the Splitter control to manage master/detail grid with horizontal layout. The first container contains a master grid with customers. After a row is clicked in master grid, in the second container is shown grid with orders that are made by this customer.
Nested Spitters: This sample demonstrates how to manage layout with nested splitters. The panel contains a Tree with continents, countries and cities. When you click on a node the map in the second splitter is centered according node's coordinates. If a country is selected, then a grid is displayed under the map with cities in that country. Panels are not resizable by default.
ASP.NET MVC Basic Usage: This example demonstrates how you can utilize the ASP.NET MVC helper for the igSplitter
.
Splitter API and Events: This sample demonstrates how to handle events in the igSplitter
control and API usage.
View on GitHub