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

SortableBuilder

Properties

WriteAction - Func

Methods

For(System.String)

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

Parameters

selector - System.String

jQuery selector

Example


            @(Html.Kendo().Sortable()
                   .For("#element")
            )

ContainerSelector(System.String)

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

Parameters

selector - System.String

jQuery selector

Example


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

HintHandler(System.Func)

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

Parameters

handler - System.Func<Object,Object>

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

Example


            @(Html.Kendo().Sortable()
                   .For("#element")
                   .HintHandler(@<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       )
            )

HintHandler(System.String)

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

Parameters

handler - System.String

JavaScript function name

Example


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

Hint(System.String)

HTML string representing the the hint element

Parameters

content - System.String

Html string

Example


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

PlaceholderHandler(System.Func)

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

Parameters

handler - System.Func<Object,Object>

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

Example


            @(Html.Kendo().Sortable()
                   .For("#element")
                   .PlaceholderHandler(@<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       )
            )

PlaceholderHandler(System.String)

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

Parameters

handler - System.String

JavaScript function name

Example


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

Placeholder(System.String)

HTML string representing the placeholder

Parameters

content - System.String

Html string

Example


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

AutoScroll(System.Boolean)

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

Parameters

value - System.Boolean

The value for AutoScroll

AutoScroll()

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

ConnectWith(System.String)

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.

Parameters

value - System.String

The value for ConnectWith

Cursor(System.String)

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

Parameters

value - System.String

The value for Cursor

CursorOffset(System.Action)

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.

Parameters

configurator - System.Action<SortableCursorOffsetSettingsBuilder>

The configurator for the cursoroffset setting.

Disabled(System.String)

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

Parameters

value - System.String

The value for Disabled

Filter(System.String)

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

Parameters

value - System.String

The value for Filter

Handler(System.String)

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.

Parameters

value - System.String

The value for Handler

HoldToDrag(System.Boolean)

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.

Parameters

value - System.Boolean

The value for HoldToDrag

HoldToDrag()

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.

Ignore(System.String)

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

Parameters

value - System.String

The value for Ignore

Axis(Kendo.Mvc.UI.SortableAxis)

Represents the Sortable widget Axis

Parameters

value - SortableAxis

The value for Axis

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<SortableEventBuilder>

The client events action.

Example


            @(Html.Kendo().Sortable()
                  .Name("Sortable")
                  .Events(events => events
                      .Start("onStart")
                  )
            )

ToComponent()

Returns the internal view component.

Expression(System.String)

Sets the name of the component.

Parameters

modelExpression - System.String

Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

Parameters

modelExplorer - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name.

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with

Parameters

deferred - System.Boolean

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The HTML attributes.

ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Object

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

Render()

Renders the component in place.

ToHtmlString()

WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

Parameters

writer - System.IO.TextWriter
encoder - System.Text.Encodings.Web.HtmlEncoder

ToClientTemplate()

AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

Parameters

value - System.Boolean
In this article
Not finding the help you need?