Created
April 3, 2013 20:59
-
-
Save artknight/5305238 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addFieldsToPrepopList: function(){ | |
var mendatoryFields = this.editor.getAssetTabItem().getMainFields().append(this.editor.getAssetTabItem().getLocationFields()); | |
//filter optional fields to match the cookie | |
var optionalFields = []; | |
var optionalFieldsCookie = this.getOptionalFieldsCookieValues() || []; | |
for (var i=0,field; field=this.editor.getAssetTabItem().getCustomFields()[i]; i++){ | |
if (optionalFieldsCookie.contains(field.getDWRField().getCode())){ | |
optionalFields.include(field); | |
} | |
} | |
//combine all fields to be pre-populated | |
var allFieldsToKeep = mendatoryFields.append(optionalFields); | |
for (var i=0,field; field=allFieldsToKeep[i]; i++){ | |
console.log(field.getDWRField().getCode()); | |
this.addFieldToPrepopList(field); | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment