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
RETURNS
Returns the current SortableBuilder instance.
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
RETURNS
Returns the current SortableBuilder instance.
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).
RETURNS
Returns the current SortableBuilder instance.
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
RETURNS
Returns the current SortableBuilder instance.
Example
@(Html.Kendo().Sortable()
.For("#element")
.HintHandler("handler")
)
Hint(System.String)
HTML string representing the the hint element
Parameters
content - System.String
Html string
RETURNS
Returns the current SortableBuilder instance.
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).
RETURNS
Returns the current SortableBuilder instance.
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
RETURNS
Returns the current SortableBuilder instance.
Example
@(Html.Kendo().Sortable()
.For("#element")
.PlaceholderHandler("handler")
)
Placeholder(System.String)
HTML string representing the placeholder
Parameters
content - System.String
Html string
RETURNS
Returns the current SortableBuilder instance.
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
RETURNS
Returns the current SortableBuilder instance.
AutoScroll()
If set to true the widget will auto-scroll the container when the mouse/finger is close to the top/bottom of it.
RETURNS
Returns the current SortableBuilder instance.
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
RETURNS
Returns the current SortableBuilder instance.
Cursor(System.String)
The cursor that will be shown while user drags sortable item.
Parameters
value - System.String
The value for Cursor
RETURNS
Returns the current SortableBuilder instance.
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.
RETURNS
Returns the current instance of SortableBuilder .
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
RETURNS
Returns the current SortableBuilder instance.
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
RETURNS
Returns the current SortableBuilder instance.
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
RETURNS
Returns the current SortableBuilder instance.
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
RETURNS
Returns the current SortableBuilder instance.
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.
RETURNS
Returns the current SortableBuilder instance.
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
RETURNS
Returns the current SortableBuilder instance.
Axis(Kendo.Mvc.UI.SortableAxis)
Represents the Sortable widget Axis
Parameters
value - SortableAxis
The value for Axis
RETURNS
Returns the current SortableBuilder instance.
Events(System.Action)
Configures the client-side events.
Parameters
configurator - System.Action<SortableEventBuilder>
The client events action.
RETURNS
Returns the current SortableBuilder instance.
Example
@(Html.Kendo().Sortable()
.Name("Sortable")
.Events(events => events
.Start("onStart")
)
)
ToComponent()
Returns the internal view component.
RETURNS
The instance that represents the component.
Expression(System.String)
Sets the name of the component.
Parameters
modelExpression - System.String
RETURNS
Returns the current instance.
Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)
Sets the name of the component.
Parameters
modelExplorer - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer
RETURNS
Returns the current instance.
Name(System.String)
Sets the name of the component.
Parameters
componentName - System.String
The name.
RETURNS
Returns the current instance.
Deferred(System.Boolean)
Suppress initialization script rendering. Note that this options should be used in conjunction with
Parameters
deferred - System.Boolean
RETURNS
Returns a DeferredWidgetBuilder instance.
HtmlAttributes(System.Object)
Sets the HTML attributes.
Parameters
attributes - System.Object
The HTML attributes.
RETURNS
Returns the current instance.
HtmlAttributes(System.Collections.Generic.IDictionary)
Sets the HTML attributes.
Parameters
attributes - System.Collections.Generic.IDictionary<String,Object>
The HTML attributes.
RETURNS
Returns the current instance.
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.
RETURNS
Returns the current instance.
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.
RETURNS
Returns the current instance.
Render()
Renders the component in place.
ToHtmlString()
Returns the HTML representation of the component.
WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)
Parameters
writer - System.IO.TextWriter
encoder - System.Text.Encodings.Web.HtmlEncoder
ToClientTemplate()
Returns the client template for the component.
AsModule(System.Boolean)
Specifies whether the initialization script of the component will be rendered as a JavaScript module.
Parameters
value - System.Boolean
RETURNS
Returns the current instance.