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

Mapping control objects telerik from javascript file external

1 Answer 61 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Cesar
Top achievements
Rank 1
Cesar asked on 30 Jul 2015, 07:56 PM

From 2 monts ago i´ve developing with this framework or suite package telerik, while i was program some aspx pages i founded some stop times for get or mapping the radcontrols from javascript file my great reason for write this post !! 

for mapping a control on our javascript we have put the next propertie ClientMode="Static" like

<telerik:RadTimePicker ClientIDMode="Static" DateInput-DateFormat="HH:mm:ss" Style="position:absolute; top:220px; left:500px" ID="_dtpMonthlyHour"  runat="server">
  </telerik:RadTimePicker>

 

and our javascript file mike this //.

var _dtpMonthlyHour=$telerik.findDatePicker("_dtpMonthlyHour");

with this line of code we can get all we want about this radControl !!

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 03 Aug 2015, 01:17 PM
Hi Cesar,

It is recommends by Microsoft to use ClientIDMode set to Static only for static controls.The RadControls on the other hand are controls with complex hierarchies of child controls and templates so setting their ClientIDMode property to Static will break their functionality. What I would recommend is that you do not use ClientIDMode Static for any Telerik controls.

You can use the approach used in our Live demos in order to access a specific control's ID from an external JavaScript file. For example you can review the source code of the following demos:
http://demos.telerik.com/aspnet-ajax/splitter/examples/overview/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/progress-bar/overview/defaultcs.aspx
etc.

Regards,
Vessy
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Documentation and Tutorials
Asked by
Cesar
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or