<# // Make sure we have an options array. if ( '' === data.field.options ) { data.field.options = []; } // JSON parse if needed. if ( '' !== data.value && 'string' === typeof data.value ) { data.value = JSON.parse( data.value ); } // Set the default value if we do not have one. if ( '' === data.value ) { data.value = Object.keys( data.field.options )[0]; } // Make sure any new options are added to the value. for ( var key in data.field.options ) { if ( jQuery.inArray( key, data.value ) === -1 ) { data.value.push( key ); } } var encodedValue = JSON.stringify( data.value ); #>
<# for ( var i in data.value ) { #>
{{data.field.options[ data.value[ i ] ]}}
<# } #>