JsRender and JsViews: Use converters for custom encoding, data formatting, localization, etc.

Converter in tags - not linked:
Convert and convertBack converters with data linking:
DataDayOffChoose day off
To edit, enter part of the name, or the number, or click here:


    <!-- RENDERING with tags -->
    <!-- data value, no converter: -->

    <!-- render from data, convert to display name -->

    <!-- DATA LINKING with data-link expressions -->
    <!-- link from data value, no converter -->
    <td data-link="dayOff"></td>

    <!-- link from data, converted to display name -->
    <td data-link="{intToDay:dayOff}"></td>

    <!-- two-way data linking with convert and convertBack between data format (integer) and display name (text) -->
    <!-- Also show data value as tooltip -->
    <td><input data-link="{intToDay:dayOff:dayToInt} title{:dayOff}" /></td>


// Data
var days = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ],

// Convert and ConvertBack
    dayToInt: function(val) {
    intToDay: function(val) {