New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring the Kendo UI Sortable for ASP.NET MVC events.

Definition

Constructors

Initializes a new instance of the SortableEventBuilder class.

C#
public SortableEventBuilder(IDictionary<string, object> events)
Parameters:eventsIDictionary<string, object>

The Sortable event handlers.

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Events(events =&gt; events.Start("handler"))
)

Methods

Defines the handler of the Cancel client-side event. Fires when item sorting is canceled by pressing the Escape key.

C#
public SortableEventBuilder Cancel(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Events(events =&gt; events.Cancel(
@&lt;text&gt;
function(e) {
//event handling code
}
&lt;/text&gt;
))
)

Defines the handler of the Cancel client-side event. Fires when item sorting is canceled by pressing the Escape key.

C#
public SortableEventBuilder Cancel(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Cancel event.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Events(events =&gt; events.Cancel("handler"))
)

Defines the handler of the Change client-side event. Fires when item is sorted and the item's position is changed in the DOM.

C#
public SortableEventBuilder Change(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Events(events =&gt; events.Change(
@&lt;text&gt;
function(e) {
//event handling code
}
&lt;/text&gt;
))
)

Defines the handler of the Change client-side event. Fires when item is sorted and the item's position is changed in the DOM.

C#
public SortableEventBuilder Change(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Change event.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Events(events =&gt; events.Change("handler"))
)

Defines the handler of the End client-side event. Fires when item dragging ends but before the item's position is changed in the DOM. This event is suitable for preventing the sort action.

C#
public SortableEventBuilder End(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Events(events =&gt; events.End(
@&lt;text&gt;
function(e) {
//event handling code
}
&lt;/text&gt;
))
)

Defines the handler of the End client-side event. Fires when item dragging ends but before the item's position is changed in the DOM. This event is suitable for preventing the sort action.

C#
public SortableEventBuilder End(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the End event.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Events(events =&gt; events.End("handler"))
)

Defines the handler of the KendoKeydown client-side event. Triggered when the user presses a keyboard key while the Sortable is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public SortableEventBuilder KendoKeydown(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Defines the handler of the KendoKeydown client-side event. Triggered when the user presses a keyboard key while the Sortable is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public SortableEventBuilder KendoKeydown(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the KendoKeydown event.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Defines the handler of the Move client-side event. Fires when Sortable's placeholder changes its position.

C#
public SortableEventBuilder Move(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Events(events =&gt; events.Move(
@&lt;text&gt;
function(e) {
//event handling code
}
&lt;/text&gt;
))
)

Defines the handler of the Move client-side event. Fires when Sortable's placeholder changes its position.

C#
public SortableEventBuilder Move(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Move event.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Events(events =&gt; events.Move("handler"))
)

Defines the handler of the Navigate client-side event. Fired when navigatable is enabled and the user changes focus between enabled items or when swapping them using the keyboard navigation.

C#
public SortableEventBuilder Navigate(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Defines the handler of the Navigate client-side event. Fired when navigatable is enabled and the user changes focus between enabled items or when swapping them using the keyboard navigation.

C#
public SortableEventBuilder Navigate(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Navigate event.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Defines the handler of the Start client-side event. Fires when sortable item drag starts.

C#
public SortableEventBuilder Start(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Events(events =&gt; events.Start(
@&lt;text&gt;
function(e) {
//event handling code
}
&lt;/text&gt;
))
)

Defines the handler of the Start client-side event. Fires when sortable item drag starts.

C#
public SortableEventBuilder Start(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Start event.

Returns:

SortableEventBuilder

Returns the current instance of SortableEventBuilder .

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Events(events =&gt; events.Start("handler"))
)