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

Client-side API

  • Demo Configurator
Navigation
Open Event at Index

RadTimeline for ASP.NET AJAX is based on the Kendo UI Timeline Widget. Thus, it exposes the Client-side API and methods offered by the widget and mainly provides a wrapper and API for working with the Timeline on the server.
You can get Client-side object reference to the Timeline control in order to use its API like this:

var radTimelineObject = $find("<%=RadTimeline1.ClientID %>");

The most commonly used RadTimeline client-side methods are:

  • get_orientation—Returns the orienation of the timeline axis.
  • open—Opens event details in horizontal mode.
  • expand—Expands an event in vertical mode.
  • collapse—Toggles the readonly state of the widget. When the widget is readonly it doesn't allow user input.
  • previous—Closes the widget popup.
  • next—Opens or closes the widget popup.

You can find the full client-side API of the control in the RadTimeline Client-side API documentation article.


Get Client-side Object Reference to the Kendo Timeline widget in order to use its API

There are two ways to get a reference to the Kendo Timeline widget in order to use its API:

  • Use the get_kendoWidget method the RadTimeline client-side object exposes. You can get the RadTimeline object through the $find() MS AJAX method:

    var radTimelineObject  = $find("<%=RadTimeline1.ClientID %>"); //the standard script control object
    var kendoTimelineObject = radTimelineObject.get_kendoWidget(); //the Kendo widget

  • Use the standard Kendo approach for getting the widget through the data-attributes of the DOM element:

    var kendoTimelineObject = $telerik.$("#<%=RadTimeline1.ClientID %>").data("kendoTimeline"); //the jQuery selector must get the RadTimeline1 select element

  • DefaultCS.aspx
  • scripts.js
  • styles.css
  • events.json
<%@ Page Language="c#" AutoEventWireup="true"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" />
    <script src="scripts.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container" runat="server">
        <telerik:RadTimeline ID="RadTimeline1" runat="server" Orientation="Horizontal">
            <WebServiceClientDataSource>
                <WebServiceSettings>
                    <Select Url="events.json" DataType="JSON" />
                </WebServiceSettings>
                <Schema>
                    <Model>
                        <telerik:ClientDataSourceModelField DataType="Date" FieldName="date" />
                    </Model>
                </Schema>
                <SortExpressions>
                    <telerik:ClientDataSourceSortExpression FieldName="date" SortOrder="Asc" />
                </SortExpressions>
            </WebServiceClientDataSource>
        </telerik:RadTimeline>
    </div>
    <script>
        function pageLoadHandler() {
            window.demoIDs = {
                tbIndex: '<%= tbIndex.ClientID %>',
            };

            window.timeline = $find("<%= RadTimeline1.ClientID %>");
        }

        Sys.Application.add_load(pageLoadHandler);
    </script>
    <qsf:ConfiguratorPanel runat="server" ID="rtlConfigurationPanel">
        <Views>
            <qsf:View>
                <qsf:ConfiguratorColumn runat="server" Size="Medium" Title="Navigation">
                    <ul class="fb-group">
                        <li>
                            <qsf:Button Width="100" runat="server" ID="btnPrev" Text="Previous" AutoPostBack="false" OnClientClicked="prev" />
                            <qsf:Button Width="100" runat="server" ID="btnNext" Text="Next" AutoPostBack="false" OnClientClicked="next" />
                        </li>

                    </ul>
                </qsf:ConfiguratorColumn>
                <qsf:ConfiguratorColumn runat="server" Size="Wide" Title="Open Event at Index">
                    <ul class="fb-group">
                        <li>
                            <qsf:NumericTextBox runat="server" IncrementSettings-Step="1" NumberFormat-DecimalDigits="0" ID="tbIndex" Value="0" MinValue="0" MaxValue="20" Width="200">
                            </qsf:NumericTextBox>
                            <qsf:Button runat="server" ID="btnOpen" Width="200" Text="Open Item" AutoPostBack="false" OnClientClicked="open" />
                        </li>
                    </ul>
                </qsf:ConfiguratorColumn>
            </qsf:View>
        </Views>
    </qsf:ConfiguratorPanel>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance