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

Client created Slider isn't active

3 Answers 86 Views
Slider
This is a migrated thread and some comments may be shown as answers.
james
Top achievements
Rank 2
james asked on 17 Jun 2008, 04:42 PM
Hi,

I was try create slider on client side. But without success. Firefox show error: "h is not a constructor"

This is my code (this code is wer simillar like Telerik's example):

function OnPageLoad() 
  responseEnded(null, null); 
 
function responseEnded(sender, eventArgs) 
  var sliderProps = { value : 50 } 
  var sliderEvents = {};
 
  $create(Telerik.Web.UI.RadSlider, sliderProps, null, null, $get("ClientSlider")); 
 

Thanks in advance,

J

3 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 20 Jun 2008, 01:57 PM
Hello James,

We tested your code within the following page:

<form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
 
        <script type="text/javascript">  
   
        function pageLoad()    
        {    
          responseEnded(null, null);    
        }    
            
        function responseEnded(sender, eventArgs)    
        {    
          var sliderProps = { value : 50 }    
          var sliderEvents = {};  
            
          $create(Telerik.Web.UI.RadSlider, sliderProps, null, null, $get("ClientSlider"));      
        }   
 
        </script> 
 
        <telerik:RadSlider ID="RadSlider1" runat="server" /> 
        <div style="width: 200px; display: none;" class="radslider RadSlider_Default horizontal" 
            id="ClientSlider">  
            <input type="hidden" name="ClientSlider_ClientState" id="RadSlider1_ClientState" 
                autocomplete="off" value="" /> 
        </div> 
    </form> 



and it worked as expected - a new RadSlider was created and it was active and had the expected functionality.

Please, note that the first declared RadSlider is put on the page in order to output the needed scripts and CSS - you do not need it in case you have already output them in another manner.

Would you please make sure that you have included the client state field, as shown in the above pasted code?
 

Best wishes,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Laku
Top achievements
Rank 1
answered on 09 Mar 2011, 08:03 AM
Hello,

I need to create multiple RadSlider controls on a client side. I am using the exact code from example and it's not working.  I am getting JavaScript error "Error: Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method." The version of telerik library I am using is 2010.2.713.40. How do I create multiple RadSlider controls on client side with my version of telerik library?

Thanks,
Kate
0
Niko
Telerik team
answered on 14 Mar 2011, 12:11 PM
Hello Eric,

Please, incorporate the following small modification to the sample code: in the style attribute of the div#ClientSlider remove the display:none; rule. If you wish to have this element not displaying before the slider is created, please, have the element appear before the call to the $create method. Also there is a typo in the id attribute of the hidden input - it should be ClientSlider_ClientState.
Here is a sample of the changed code:
<div style="width: 200px;" class="radslider RadSlider_Default horizontal" id="ClientSlider"
        <input type="hidden" name="ClientSlider_ClientState" id="ClientSlider_ClientState" autocomplete="off" value="" />
</div>


Best wishes,
Nikodim
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Slider
Asked by
james
Top achievements
Rank 2
Answers by
Svetlina Anati
Telerik team
Laku
Top achievements
Rank 1
Niko
Telerik team
Share this question
or