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

Defines the fluent interface for configuring the Sortable component.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class SortableBuilder : IHtmlString

Inheritance: objectSortableBuilder

Implements: IHtmlString

Inherited Members object.GetType()object.MemberwiseClone()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

The component.

Methods

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

C#
public virtual SortableBuilder AutoScroll(bool value)
Parameters:valueboolReturns:

SortableBuilder

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

Constrains the hint movement to either the horizontal (x) or vertical (y) axis.

C#
public virtual SortableBuilder Axis(SortableAxis axis)
Parameters:axisSortableAxis

The axis

Returns:

SortableBuilder

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

The selector which determines if items from the current Sortable component 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 components.

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

jQuery selector

Returns:

SortableBuilder

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

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

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

The CSS style which determines the cursor that will be shown while user drags sortable item. For example 'move', 'pointer', etc.

C#
public virtual SortableBuilder Cursor(string cursor)
Parameters:cursorstring

String

Returns:

SortableBuilder

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

Configures the cursor offset of Sortable component.

C#
public virtual SortableBuilder CursorOffset(Action<SortableCursorOffsetSettingsBuilder> cursorOffsetSettingsAction)
Parameters:cursorOffsetSettingsActionAction<SortableCursorOffsetSettingsBuilder>

Cursor offset settings action.

Returns:

SortableBuilder

Example:
C#
@(Html.Kendo().Sortable()
.For("#element")
.CursorOffset(co =&gt; co.Top(12))
)

Suppress initialization script rendering. Note that this options should be used in conjunction with WidgetFactory.DeferredScripts(bool)

C#
public virtual SortableBuilder Deferred()
Returns:

SortableBuilder

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

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

jQuery selector

Returns:

SortableBuilder

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

Sets the event configuration of the Sortable.

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

The lambda which configures the events

Returns:

SortableBuilder

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

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

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

jQuery selector

Returns:

SortableBuilder

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

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

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

jQuery selector

Returns:

SortableBuilder

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

The selector that determines which element will be used as a draggable handler.

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

jQuery selector

Returns:

SortableBuilder

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

HTML string representing the hint element

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

Html string

Returns:

SortableBuilder

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

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

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

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.

C#
public virtual SortableBuilder HoldToDrag(bool value)
Parameters:valueboolReturns:

SortableBuilder

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

The selector which determines child elements for which the sort will not be initiated. Useful if the sortable item contains input elements.

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

jQuery selector

Returns:

SortableBuilder

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

HTML string representing the placeholder

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

Html string

Returns:

SortableBuilder

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

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

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

Renders the component.

C#
public virtual void Render()
C#
public MvcHtmlString ToClientTemplate()
Returns:

MvcHtmlString

Returns the internal view component.

C#
public Sortable ToComponent()
Returns:

Sortable

C#
public string ToHtmlString()
Returns:

string

C#
public override string ToString()
Returns:

string

Overrides: object.ToString()

Operators

C#
public static implicit operator Sortable(SortableBuilder builder)
Parameters:builderSortableBuilderReturns:

Sortable