locked
Is enableClear on the Rating control bugged? Doesn't seem to work.

    Question

  • enableClear is supposed to be true by default on the Rating control, but once selected with a value with a mouse or tap, there is no way to "un-rate" it. Is enableClear bugged?

    The enabledClear description is:
    Gets or sets whether the Rating can be cleared by the user.

    The default value is true.

    Tuesday, February 14, 2012 9:05 PM

Answers

  • No, I have the old build :-).

    Drag from the right to left on the control.  That will reset the rating.


    Jeff Sanders (MSFT)


    Wednesday, February 15, 2012 4:03 PM
    Moderator

All replies

  • Seems to work great for me:

    Html:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title>WinWebApp4</title>
        <!-- WinJS references -->
        <link rel="stylesheet" href="/winjs/css/ui-dark.css" />
        <script src="/winjs/js/base.js"></script>
        <script src="/winjs/js/ui.js"></script>
        <script src="/winjs/js/binding.js"></script>
        <script src="/winjs/js/controls.js"></script>
        <script src="/winjs/js/animations.js"></script>
        <script src="/winjs/js/uicollections.js"></script>
        <script src="/winjs/js/wwaapp.js"></script>
        <script src="/winjs/js/res.js"></script>
    <!-- WinWebApp4 references -->
        <link rel="stylesheet" href="/css/default.css" />
        <script src="/js/default.js"></script>
    </head>
    <body>
        <div id="ratingControl" data-win-control="WinJS.UI.Rating"
        data-win-options="{averageRating : 3.4}"></div>
    
    </body>
    </html>
    

    JS:

    (function () {
        'use strict';
        // Uncomment the following line to enable first chance exceptions.
        // Debug.enableFirstChanceException(true);
    
        WinJS.Application.onmainwindowactivated = function (e) {
            if (e.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {
                WinJS.UI.processAll();
            }
        }
    
        WinJS.Application.start();
    })();

    What are you doing different?  Does this code work for you?

    -Jeff


    Jeff Sanders (MSFT)

    Wednesday, February 15, 2012 3:29 PM
    Moderator
  • Nothing as far as I can tell, it's just a rating control with nothing special, even a blank one with no options, still can't clear. When you click one star, you can click one star again to have a rating of zero?

    ...and you're on the dev preview and not a nightly build? :)

    Wednesday, February 15, 2012 3:57 PM
  • No, I have the old build :-).

    Drag from the right to left on the control.  That will reset the rating.


    Jeff Sanders (MSFT)


    Wednesday, February 15, 2012 4:03 PM
    Moderator
  • I see it yeah, swipe right to left and it clears. I think that's what you meant, swiping from left to right sets the rating to 5/max.
    Wednesday, February 15, 2012 4:12 PM
  • Fixed :-)

    Jeff Sanders (MSFT)

    Wednesday, February 15, 2012 8:23 PM
    Moderator