public/libs/obviel/1.0b5/obviel-forms.js
function(source, target) {
        var linkedTarget = $(target);
        clearLinkedData(target);
        $.each(source, function(key, sourceValue) {
            if (isInternal(key)) {
                return;
            }
            var targetValue = null;
            if ($.isPlainObject(sourceValue)) {
                targetValue = target[key];
                setLinkedData(sourceValue, targetValue);
            } else if ($.isArray(sourceValue)) {
                targetValue = target[key];
                $.each(sourceValue, function(index, arrayValue) {
                    var targetArrayValue = targetValue[index];
                    setLinkedData(arrayValue, targetArrayValue);
                });
            } else {
                linkedTarget.setField(key, sourceValue);
            }
            return;
        });
    }
function(source, target) {
        var linkedTarget = $(target);
        clearLinkedData(target);
        $.each(source, function(key, sourceValue) {
            if (isInternal(key)) {
                return;
            }
            var targetValue = null;
            if ($.isPlainObject(sourceValue)) {
                targetValue = target[key];
                setLinkedData(sourceValue, targetValue);
            } else if ($.isArray(sourceValue)) {
                targetValue = target[key];
                $.each(sourceValue, function(index, arrayValue) {
                    var targetArrayValue = targetValue[index];
                    setLinkedData(arrayValue, targetArrayValue);
                });
            } else {
                linkedTarget.setField(key, sourceValue);
            }
            return;
        });
    }
function ( source , target ) { var linkedTarget = $ ( target ) ; clearLinkedData ( target ) ; $ . each ( source , function ( key , sourceValue ) { if ( isInternal ( key ) ) { return ; } var targetValue = null ; if ( $ . isPlainObject ( sourceValue ) ) { targetValue = target [ key ] ; setLinkedData ( sourceValue , targetValue ) ; } else if ( $ . isArray ( sourceValue ) ) { targetValue = target [ key ] ; $ . each ( sourceValue , function ( index , arrayValue ) { var targetArrayValue = targetValue [ index ] ; setLinkedData ( arrayValue , targetArrayValue ) ; } ) ; } else { linkedTarget . setField ( key , sourceValue ) ; } return ; } ) ; }
use setField to set values in target according to source source and target must have same structure
use setField to set values in target according to source source and target must have same structure