[CLOSED] problem with slider setValue on clientside

  1. #1

    [CLOSED] problem with slider setValue on clientside

    I'm having trouble setting the value of a slider. I want to change the slider value according to a numericfiield on the client side but not successful. However if I do it the other way round, i.e. change the numericfield according to the slider value, it works. Here is the sample code please investigate. Thank you so much.

    <%@ Page Language="C#"  %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
           <ext:Panel runat="server"     >
           <Items>
               <ext:Slider ID="sldScore" runat="server" MaxValue="100"  width="300" Padding="5" FieldLabel="slider">
                 <Listeners>
                    <Change Handler="#{numScore}.setValue(#{sldScore}.getValue());" Buffer="500" />                                   
                                       
                    </Listeners>     
            </ext:Slider>
                                                   
            <ext:NumberField ID="numScore"  FieldLabel="number" runat="server" width="200" Padding="5" MinValue="0" MaxValue="100" Text="0" >
                <Listeners >
                    <Change  Handler="#{sldScore}.setValue(#{numScore}.getValue());" Buffer="500" />
                                                        
                </Listeners>
            </ext:NumberField>
    </Items>
    </ext:Panel>
    
    
      
        </form>
    </body>
    </html>
    Last edited by Daniil; Jul 11, 2012 at 3:38 PM. Reason: [CLOSED]
  2. #2
    Hi,

    There is a Multi Slider instance internally. The first argument should be a thumb index.
    http://docs.sencha.com/ext-js/4-1/#!...ethod-setValue
  3. #3
    oh thank you so much :) I though the single and multiple were different classes!! lucky i subscribed to this forum otherwise i'm going to spend days not wondering what's wrong with the code....
  4. #4
    Thanks for the excellent feedback:)

    Yes, there are two JavaScript classes in ExtJS: Ext.slider.Multi and Ext.slider.Single, and besides the Single one is a subclass of the Multi one.

    We decided to don't separate them on server side. C# OOP is more cumbersome than JavaScript:)

Similar Threads

  1. [CLOSED] Slider control - SetValue()
    By DougMcDonald in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Jul 16, 2012, 9:47 PM
  2. [CLOSED] How to programaticaly set the value of a slider?
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Jun 11, 2012, 2:33 PM
  3. Problem with slider
    By JosefTrbusek in forum 1.x Help
    Replies: 0
    Last Post: Mar 07, 2012, 10:44 AM
  4. problem with slider
    By Stefano in forum 1.x Help
    Replies: 0
    Last Post: Jan 13, 2009, 7:50 PM
  5. [CLOSED] slider example
    By Lex in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 22, 2008, 11:24 AM

Tags for this Thread

Posting Permissions