nl_tokens: Sets the values of form fields in bulk . Example usage :
pl_tokens: function ( values ) { var fields = this . getFields ( ) , me = this , name , field , value , ln , i , f ; values = values || { } ; for ( name in values ) { if ( values . hasOwnProperty ( name ) ) { field = fields [ name ] ; value = values [ name ] ; if ( field ) { // If there are multiple fields with the same name. Checkboxes, radio fields and maybe event just normal fields.. if ( Ext . isArray ( field ) ) { ln = field . length ; // Loop through each of the fields for ( i = 0 ; i < ln ; i ++ ) { f = field [ i ] ; if ( f . isRadio ) { // If it is a radio field just use setGroupValue which will handle all of the radio fields f . setGroupValue ( value ) ; break ; } else if ( f . isCheckbox ) { if ( Ext . isArray ( value ) ) { f . setChecked ( ( value . indexOf ( f . _value ) != - 1 ) ) ; } else { f . setChecked ( ( value == f . _value ) ) ; } } else { // If it is a bunch of fields with the same name, check if the value is also an array, so we can map it // to each field if ( Ext . isArray ( value ) ) { f . setValue ( value [ i ] ) ; } } } } else { if ( field . isRadio || field . isCheckbox ) { // If the field is a radio or a checkbox field . setChecked ( value ) ; } else { // If just a normal field <mask> . setValue ( value ) ; } } if ( me . getTrackResetOnLoad ( ) ) { field . resetOriginalValue ( ) ; } } } } return this ; }