New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

RadDrawer Object

This article lists the client-side API of RadDrawer and how to use it.

To use the API, you must first get a reference to the control's client-side object. For example:

JavaScript
var drawerObject = $find("<%=RadDrawer1.ClientID %>");

RadDrawer is a server-side wrapper over the Kendo UI Drawer Widget. Thus, it exposes the API of the underlying Kendo widget. To get a reference to the Kendo widget instance, you can do either of the following:

  • Use the get_kendoWidget() method of the MS AJAX wrapper:
JavaScript
var drawerObject  = $find("<%=RadDrawer1.ClientID %>"); // The standard script control object
var kendoDrawer = drawerObject.get_kendoWidget(); // The Kendo widget
  • Get the Kendo Widget in its usual way. Make sure to use the $telerik.$ jQuery reference:
JavaScript
var kendoDrawer = $telerik.$("#<%=RadDrawer1.ClientID %>").data("kendoDrawer"); 

In addition to using the Kendo method directly, you can also use their wrappers that follow the MS AJAX convention through the RadDrawer client object.

Table1: Client-side methods exposed by the MS AJAX RadDrawer object

NameParametersReturn TypeDescription
shownonenoneShows the drawer.
hidenonenoneHides the drawer.
destroynonenoneDestroys the underlying Kendo widget (calls its destroy method). Once you call it, you will not be able to use the widget or control.
get_visiblenoneBooleanReturns true if the drawer is opened.
get_positionnoneStringReturns the position of the Drawer. The possible values are left and right.
get_swipeToOpennoneBooleanReturns whether the Drawer can be toggled with gestures.
repaintBooleannoneRepaints the control. The "force" argument determines whether the resizing routine should be executed even if the respective widget's outer dimensions have not changed.
get_elementnoneHTML elementReturns the drawer's element, containing the id and the client-side object of the Drawer. It has the RadDrawer class.
get_outerWrappernonejQuery elementReturns an element that contains the items and the content element wrappers. It can contain classes that indicate the drawer's mode and position.
get_contentElementnonejQuery elementReturns the content element from the ContentTemplate. It has the .k-drawer-content CSS class.
get_drawerContainernoneBooleanReturn drawer's container element. It contains the items wrapper element
get_drawerItemsWrappernoneBooleanReturns the items wrapper element declared in the Items template and has the .k-drawer-items CSS class.
get_drawerElementnoneBooleanReturns the root element declared in the ItemsTemplate.

See Also

In this article
See Also
Not finding the help you need?
Contact Support