Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2011
    Posts
    35
    Rep Power
    0

    Default how to focus dojo slider to a particular value and then disabling dojo slider so that

    How to focus dojo slider to a particular value (say 2.5 )on the slider and then disabling dojo slider so that value not changes on clicking on the dojo slider?ie i want to focus dojo slider to a particular value and then make it disable.
    Java Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html dir="ltr">
    
        <head>
            <style type="text/css">
                body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }
            </style>
            <script src="../cmic/dojo/dojo/dojo.js"
            djConfig="parseOnLoad: true">
            </script>
            <script type="text/javascript">
                dojo.require("dijit.form.Slider");
                dojo.require("dijit.form.TextBox"); // this we only include to make the textinput look prettier
                dojo.addOnLoad(function() {
    
                    var slider = new dijit.form.HorizontalSlider({
                        name: "slider",
                        value: 0,
                        minimum: 0,
                        maximum: 10,
                        intermediateChanges: true,
                        style: "width:700px;",
                        onChange: function(value) {
                         dojo.byId("sliderValue").value = value;
                        }
                    },
                    "slider");
                });
            </script>
            <link rel="stylesheet" type="text/css" href="../cmic/dojo/dijit/themes/claro/claro.css"
            />
        </head>
    
        <body class=" claro ">
    
            <div id="slider"  intermediateChanges="true" showButtons="false" style="width:400px;color:#606060;">
            <ol dojoType="dijit.form.HorizontalRuleLabels" container="topDecoration"
                style="height:1.5em;color:#585858;font-size:75%;color:gray;">
            <li>0
                    </li>
                 <li>
                        2
                    </li>
                    <li>
                        4
                    </li>
                    <li>
                        6
                    </li>
                 <li>
                        8
                    </li>
                    <li>10
                    </li>
                </ol>
    
    
    
            <ol dojoType="dijit.form.HorizontalRuleLabels" container="topDecoration"
                style="height:1.5em;font-size:90%;color:#606060;margin:-1em 0px 0px 7.00em;">
    
                   <li>
                        Outstanding
                    </li>
                    <li>
                        Highly effective
                    </li>
                    <li>
                        &nbsp&nbspEffective
                    </li>
                    <li>
                           &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbspNeeds Improvement
                    </li>
                    <li>
                          &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbspNot Acceptable
                    </li>
                   <li>
    
                    </li></ol>
    
    
        </div>
            <p>
                <input type="text" id="sliderValue" dojoType="dijit.form.TextBox" />
            </p>
            <script type="text/javascript">
                dojo.addOnLoad(function() {
                    if (document.pub) {
                        document.pub();
                    }
                });
            </script>
        </body>
    
    </html>

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,244
    Rep Power
    19

Similar Threads

  1. Reversing dojo slider to make it slide from right to left rather left to right as giv
    By gurpreet.singh in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 05-05-2011, 01:49 PM
  2. Image Slider Help
    By matthew707 in forum New To Java
    Replies: 1
    Last Post: 01-04-2011, 04:37 PM
  3. progress bar with slider
    By paddala in forum AWT / Swing
    Replies: 1
    Last Post: 10-17-2010, 01:48 PM
  4. how to zoom using slider
    By kumar_gemi in forum New To Java
    Replies: 0
    Last Post: 07-11-2009, 10:06 PM
  5. How to use Slider in SWT
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-02-2008, 08:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •