Available in the OSS Version

Rating - TypeScript

This sample demonstrates how to create a rating control with dynamically changeable options for size of the step of the selected items.

Select precision and decimal places

Current value:
Value as percent:
Precision:

This sample is designed for a larger screen size.

On mobile, try rotating your screen, view full size, or email to another device.

The precision option changes the precision of the rating control. Set the accuracy of the value with the "value as percent" property.

Code View

Copy to Clipboard
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <!-- Ignite UI for jQuery Required Combined CSS Files -->
    <link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
    <link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/structure/infragistics.css" rel="stylesheet" />

    <script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>

    <!-- Ignite UI for jQuery Required Combined JavaScript Files -->
    <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.core.js"></script>
    <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.lob.js"></script>

</head>
<body>
    <p>Select precision and decimal places</p>
    <div id="rating"></div>

    <table>
        <tr>
            <td>Current value:</td>
            <td>
                <div id="currValue" style="width:70%"></div>
            </td>
        </tr>
        <tr>
            <td>Value as percent:</td>
            <td>
                <input id="chkPercent" type="checkbox" checked />
            </td>
        </tr>
        <tr>
            <td>Precision:</td>
            <td>
                <div class="comboContainer">
                    <select id="selectPrecision">
                        <option value="exact">Exact</option>
                        <option value="half">Half</option>
                        <option value="whole" selected="selected">Whole (default)</option>
                    </select>
                </div>
            </td>
        </tr>
    </table>

    <script src="/TypeScriptSamples/rating/typescript.js"></script>
</body>
</html>