This is a migrated thread and some comments may be shown as answers.

Find RadDatePicker object in client side

1 Answer 190 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Luis
Top achievements
Rank 1
Luis asked on 25 Feb 2009, 08:09 PM
Hello guys

i need to find the raddatepicker control in client side for compare two dates.

i tried next code with no results.

                              var panelbar = $find("<%= RadPanelBar1.ClientID %>");
                               var item = panelbar.findItemByText("Reports");
                               var datePicker = item.findControl("rdpStartDate");

this is the source code.

<telerik:RadSplitter ID="MainSplitter" runat="server" Height="100%" Width="100%" Orientation="Horizontal" Skin="Outlook">  
    <telerik:RadPane ID="TopPane" runat="server" Height="1" MinHeight="1" MaxHeight="1"  Scrolling="none">                              
     </telerik:RadPane>  

    <telerik:RadSplitBar ID="RadsplitbarTop" runat="server" CollapseMode="Forward" />  

    <telerik:RadPane ID="MainPane" runat="server" Scrolling="none" MinWidth="500"><telerik:RadSplitter ID="NestedSplitter" runat="server" Skin="Outlook" LiveResize="true"><telerik:RadPane ID="LeftPane" runat="server" Width="220" MinWidth="220" MaxWidth="220">
    <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Skin="Office2007" ExpandMode="FullExpandedItem">
            <CollapseAnimation Duration="100" Type="None" />
            <Items>
            <telerik:RadPanelItem Value="Reports"  Text="Reports" ImageUrl="Img/tasks.gif" Expanded="True">
                    <ItemTemplate>
                                     
                    <telerik:RadDatePicker ID="rdpStartDate" runat="server" Skin="Office2007"
                        Width="85">
                        <DateInput
                             DateFormat="dd/MM/yy"
                             DisplayDateFormat="dd/MMM/yyyy"
                             EmptyMessage ="dd/mm/aa"
                             >
                        </DateInput>
                        <DatePopupButton TabIndex="-1" />
                    </telerik:RadDatePicker>
                    
                    </ItemTemplate>
            </telerik:RadPanelItem>
            
            </Items>
            <ExpandAnimation Duration="100" Type="None" />
            </telerik:RadPanelBar>
            </telerik:RadPane><telerik:RadSplitBar ID="VerticalSplitBar" runat="server" CollapseMode="Forward" />
            <telerik:RadPane ID="ContentPane" runat="server">
            </telerik:RadPane></telerik:RadSplitter>
            </telerik:RadPane>  
</telerik:RadSplitter> 


thanks in advanced.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 26 Feb 2009, 07:42 AM
Hello Luis,

A possible approach to find a control, residing in a naming container is to search in Sys.Application components collection:

Example:
function getAllPickers() 
  var components = Sys.Application.getComponents(); 
  for (var i = 0; i < components.length; i++) 
  { 
    var type = Object.getType(components[i]).getName(); 
    if (type == "Telerik.Web.UI.RadDatePicker"
      alert(components[i].get_id();); 
  } 

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Luis
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or