nl_tokens: Returns an object containing the value of each field in the form keyed to the field s name . For groups of checkbox fields with the same name it will be arrays of values . For example :
pl_tokens: function ( enabled , all ) { var fields = this . getFields ( ) , values = { } , isArray = Ext . isArray , field , value , addValue , bucket , name , ln , i ; // Function which you give a field and a name, and it will add it into the values // object accordingly addValue = function ( field , name ) { if ( ! all && ( ! name || name === 'null' ) || field . isFile ) { return ; } if ( field . isCheckbox ) { value = field . getSubmitValue ( ) ; } else { value = field . getValue ( ) ; } if ( ! ( enabled && field . getDisabled ( ) ) ) { // RadioField is a special case where the value returned is the fields valUE // ONLY if it is checked if ( field . isRadio ) { if ( field . isChecked ( ) ) { values [ name ] = value ; } } else { // Check if the value already exists bucket = values [ name ] ; if ( ! Ext . isEmpty ( bucket ) ) { // if it does and it isn't an array, we need to make it into an array // so we can push more if ( ! isArray ( bucket ) ) { bucket = values [ name ] = [ bucket ] ; } // Check if it is an array if ( isArray ( value ) ) { // Concat it into the other values bucket = values [ name ] = bucket . concat ( value ) ; } else { // If it isn't an array, just pushed more values bucket . push ( value ) ; } } else { values [ name ] = value ; } } } } ; // Loop through each of the fields, and add the values for those fields. for ( <mask> in fields ) { if ( fields . hasOwnProperty ( name ) ) { field = fields [ name ] ; if ( isArray ( field ) ) { ln = field . length ; for ( i = 0 ; i < ln ; i ++ ) { addValue ( field [ i ] , name ) ; } } else { addValue ( field , name ) ; } } } return values ; }