backbone-formview.js
function (possibleVal, isChecked, index) {
            var $listItem;
            var $label;
            var id = this.inputId;
            var attributes = { type: 'checkbox', value: possibleVal.value};

            if (this.addId) { extend(attributes, { name: id, id: (id + '-' + index) }); }
            attributes = extend(attributes, this.inputAttrs);
            if (this.inputClass) { attributes.class = this.inputClass; }
            if (isChecked) { attributes.checked = 'checked'; }
            $listItem = Backbone.$('<input>').attr(attributes);
            $label = Backbone.$('<label>').attr(defaults(this.labelAttrs || {}, { 'class': 'checkbox' }));
            return $label.append($listItem).append(possibleVal.display);
        }
function (possibleVal, isChecked, index) {
            var $listItem;
            var $label;
            var id = this.inputId;
            var attributes = { type: 'checkbox', value: possibleVal.value};

            if (this.addId) { extend(attributes, { name: id, id: (id + '-' + index) }); }
            attributes = extend(attributes, this.inputAttrs);
            if (this.inputClass) { attributes.class = this.inputClass; }
            if (isChecked) { attributes.checked = 'checked'; }
            $listItem = Backbone.$('<input>').attr(attributes);
            $label = Backbone.$('<label>').attr(defaults(this.labelAttrs || {}, { 'class': 'checkbox' }));
            return $label.append($listItem).append(possibleVal.display);
        }
function ( possibleVal , isChecked , index ) { var $listItem ; var $label ; var id = this . inputId ; var attributes = { type : 'checkbox' , value : possibleVal . value } ; if ( this . addId ) { extend ( attributes , { name : id , id : ( id + '-' + index ) } ) ; } attributes = extend ( attributes , this . inputAttrs ) ; if ( this . inputClass ) { attributes . class = this . inputClass ; } if ( isChecked ) { attributes . checked = 'checked' ; } $listItem = Backbone . $ ( '<input>' ) . attr ( attributes ) ; $label = Backbone . $ ( '<label>' ) . attr ( defaults ( this . labelAttrs || { } , { 'class' : 'checkbox' } ) ) ; return $label . append ( $listItem ) . append ( possibleVal . display ) ; }
Renders and returns a single checkbox in a CheckList
@memberOf Backbone.fields.CheckListView#
@param {string} possibleVal the key from possibleVals
@param {boolean} isChecked if the box should be checked or not
@param {number} index the index of the checkbox
@return {$}
Renders and returns a single checkbox in a CheckList