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

Defines the fluent API for configuring the Kendo UI Sortable

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class SortableBuilder : WidgetBuilderBase<Sortable, SortableBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<Sortable, SortableBuilder>SortableBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<Sortable, SortableBuilder>.ToComponent()WidgetBuilderBase<Sortable, SortableBuilder>.Expression(string)WidgetBuilderBase<Sortable, SortableBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<Sortable, SortableBuilder>.Name(string)WidgetBuilderBase<Sortable, SortableBuilder>.Deferred(bool)WidgetBuilderBase<Sortable, SortableBuilder>.HtmlAttributes(object)WidgetBuilderBase<Sortable, SortableBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<Sortable, SortableBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<Sortable, SortableBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<Sortable, SortableBuilder>.Render()WidgetBuilderBase<Sortable, SortableBuilder>.ToHtmlString()WidgetBuilderBase<Sortable, SortableBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<Sortable, SortableBuilder>.ToClientTemplate()WidgetBuilderBase<Sortable, SortableBuilder>.AsModule(bool)WidgetBuilderBase<Sortable, SortableBuilder>.ComponentWidgetBuilderBase<Sortable, SortableBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the SortableBuilder class.

C#
public SortableBuilder(Sortable component)
Parameters:componentSortable

Methods

If set to true the widget will auto-scroll the container when the mouse/finger is close to the top/bottom of it.

C#
public SortableBuilder AutoScroll()
Returns:

SortableBuilder

Returns the current SortableBuilder instance.

If set to true the widget will auto-scroll the container when the mouse/finger is close to the top/bottom of it.

C#
public SortableBuilder AutoScroll(bool value)
Parameters:valuebool

The value for AutoScroll

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Represents the Sortable widget Axis

C#
public SortableBuilder Axis(SortableAxis value)
Parameters:valueSortableAxis

The value for Axis

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Selector which determines if items from the current Sortable widget can be accepted from another Sortable container(s). The connectWith option describes one way relationship, if the developer wants a two way connection then the connectWith option should be set on both widgets.

C#
public SortableBuilder ConnectWith(string value)
Parameters:valuestring

The value for ConnectWith

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Selector that determines the container boundaries in which hint movement will be constrained to.

C#
public virtual SortableBuilder ContainerSelector(string selector)
Parameters:selectorstring

jQuery selector

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.ContainerSelector("#element2")
)

The cursor that will be shown while user drags sortable item.

C#
public SortableBuilder Cursor(string value)
Parameters:valuestring

The value for Cursor

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

If set, specifies the offset of the hint relative to the mouse cursor/finger. By default, the hint is initially positioned on top of the draggable source offset. The option accepts an object with two keys: top and left.

C#
public SortableBuilder CursorOffset(Action<SortableCursorOffsetSettingsBuilder> configurator)
Parameters:configuratorAction<SortableCursorOffsetSettingsBuilder>

The SortableCursorOffsetSettingsBuilder for the cursoroffset setting.

Returns:

SortableBuilder

Returns the current instance of SortableBuilder .

Selector that determines which items are disabled. Disabled items cannot be dragged but are valid sort targets.

C#
public SortableBuilder Disabled(string value)
Parameters:valuestring

The value for Disabled

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Configures the client-side events.

C#
public SortableBuilder Events(Action<SortableEventBuilder> configurator)
Parameters:configuratorAction<SortableEventBuilder>

The client events action.

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Example:
C#
@(Html.Kendo().Sortable()
.Name("Sortable")
.Events(events =&gt; events
.Start("onStart")
)
)

Selector that determines which items are sortable. Filtered items cannot be dragged and are not valid sort targets.

C#
public SortableBuilder Filter(string value)
Parameters:valuestring

The value for Filter

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

The selector to match the DOM element to which the Sortable widget will be instantiated

C#
public virtual SortableBuilder For(string selector)
Parameters:selectorstring

jQuery selector

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
)

Selector that determines which element will be used as a draggable handler. If a handler is defined, the user will be able to move the Sortable items only if the cursor/finger is positioned onto the handler element.

C#
public SortableBuilder Handler(string value)
Parameters:valuestring

The value for Handler

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

HTML string representing the hint element

C#
public virtual SortableBuilder Hint(string content)
Parameters:contentstring

Html string

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Hint("content")
)

Sets JavaScript function which to return the hint for the sorted item.

C#
public virtual SortableBuilder HintHandler(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag (Razor syntax).

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

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

Sets JavaScript function which to return the hint for the sorted item.

C#
public virtual SortableBuilder HintHandler(string handler)
Parameters:handlerstring

JavaScript function name

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.HintHandler("handler")
)

Suitable for touch oriented user interface, in order to avoid collision with the touch scrolling gesture. When set to true, the item will be activated after the user taps and holds the finger on the element for a short amount of time. The item will also be activated by pressing, holding and lifting the finger without any movement. Dragging it afterwards will initiate the drag immediately.

C#
public SortableBuilder HoldToDrag()
Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Suitable for touch oriented user interface, in order to avoid collision with the touch scrolling gesture. When set to true, the item will be activated after the user taps and holds the finger on the element for a short amount of time. The item will also be activated by pressing, holding and lifting the finger without any movement. Dragging it afterwards will initiate the drag immediately.

C#
public SortableBuilder HoldToDrag(bool value)
Parameters:valuebool

The value for HoldToDrag

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Selector that determines which elements inside the sorted item's container will be ignored. Useful if the sortable item contains input elements.

C#
public SortableBuilder Ignore(string value)
Parameters:valuestring

The value for Ignore

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

If set to true, the user can navigate the widget with the keyboard. By default, keyboard navigation is disabled.

C#
public SortableBuilder Navigatable()
Returns:

SortableBuilder

Returns the current SortableBuilder instance.

If set to true, the user can navigate the widget with the keyboard. By default, keyboard navigation is disabled.

C#
public SortableBuilder Navigatable(bool value)
Parameters:valuebool

The value for Navigatable

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

HTML string representing the placeholder

C#
public virtual SortableBuilder Placeholder(string content)
Parameters:contentstring

Html string

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.Placeholder("content")
)

Sets JavaScript function which to return the placeholder for the sorted item.

C#
public virtual SortableBuilder PlaceholderHandler(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag (Razor syntax).

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

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

Sets JavaScript function which to return the placeholder for the sorted item.

C#
public virtual SortableBuilder PlaceholderHandler(string handler)
Parameters:handlerstring

JavaScript function name

Returns:

SortableBuilder

Returns the current SortableBuilder instance.

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.PlaceholderHandler("handler")
)