locked
Bug ? WinJS.UI.Rating.enableClear does NOT work

    Question

  • the link is http://msdn.microsoft.com/en-us/library/windows/apps/br211893.aspx

    The HTML:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title>Test1</title>
    
        <!-- WinJS references -->
        <link href="//Microsoft.WinJS.1.0.RC/css/ui-light.css" type="text/css" rel="stylesheet" />
        <script src="//Microsoft.WinJS.1.0.RC/js/base.js"></script>
        <script src="//Microsoft.WinJS.1.0.RC/js/ui.js"></script>
    
        <!-- Test1 references -->
        <link rel="stylesheet" type="text/css" href="css/css/ui-lightness/jquery-ui-1.8.21.custom.css" />
        <link href="default.css" rel="stylesheet" />
        <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.21.custom.min.js"></script>
        <script type="text/javascript" src="js/custom.js"></script>
        <script src="default.js"></script>
    </head>
    
    <body>
        <h1>App H2O</h1>
        <p id="p1">Lorem Ipsum LOREM IPSUM !!!!! LOOREM IPSUUUM.</p>
        <p id="p2">Lorem Ipsum LOREM IPSUM !!!!! LOOREM IPSUUUM.</p>
        <p id="p3">Lorem Ipsum LOREM IPSUM !!!!! LOOREM IPSUUUM.</p>
        <p id="p4">Lorem Ipsum LOREM IPSUM !!!!! LOOREM IPSUUUM.</p>
        <div id="div1"></div>
    </body>
    </html>

    The JS:

    (function () {
    
        WinJS.strictProcessing();
    
        WinJS.Application.onactivated = function (args) {
    
            if (args.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {
    
                if (args.detail.previousExecutionState !== Windows.ApplicationModel.Activation.ApplicationExecutionState.terminated) {
    
                    // TODO: This application has been newly launched.
                   
                   
    
                    WinJS.Utilities.ready(function () {
    
                        var o_rating1 = new WinJS.UI.Rating($('#div1')[0], {
                            enableClear:  true
    
                       });
                        
                    });
    
                    
                } else {
    
                    // This application has been reactivated from suspension. Restore application state here.
                }
                args.setPromise(WinJS.UI.processAll());
            }
        };
    
        WinJS.Application.oncheckpoint = function (args) {
    
            // TODO: This application is about to be suspended. Save any state
            // that needs to persist across suspensions here. You might use the
            // WinJS.Application.sessionState object, which is automatically
            // saved and restored across suspension. If you need to complete an
            // asynchronous operation before your application is suspended, call
            // args.setPromise().
        };
    
        WinJS.Application.start();
    
    })();


    Tuesday, June 19, 2012 1:27 AM

Answers

  • Hi,

    What do you mean by “not work”? It is needed to slide the mouse/finger from the right to the left side of the rating control and then lift.

    Best Regards,

    Ming Xu.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework

    Tuesday, June 19, 2012 10:52 AM
    Moderator

All replies

  • Hi,

    What do you mean by “not work”? It is needed to slide the mouse/finger from the right to the left side of the rating control and then lift.

    Best Regards,

    Ming Xu.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework

    Tuesday, June 19, 2012 10:52 AM
    Moderator
  • turns out there must be available left margin otherwise you can't drag it to "0" / "clear". Mine was on the edge of the left (left: 0px) so i can't drag it to 0. It works.
    Tuesday, June 19, 2012 11:57 AM