code: function(e) {
  		Event.stopEvent(e);	
  		var target = Event.getTarget(e),
        record = this.datatable.getRecord(target),
  		field, requiredFields = [];
  
  		for(var i=0, fieldsLength = this.options.fields.length; i<fieldsLength; i++){
  			field = this.options.fields[i];
  			
  			// Retro-compatibility with inputParms
           if (lang.isObject(field.inputParams)) {
              
              if( !lang.isUndefined(field.inputParams.required) ){
     				if( lang.isUndefined(record.getData(field.inputParams.name)) ){
     					requiredFields.push(field.inputParams.label);
     				}
     			}
  
           // New prefered way to set options of a field
           } else {
              
              if( !lang.isUndefined(field.required) ){
     				if( lang.isUndefined(record.getData(field.name)) ){
     					requiredFields.push(field.label);
     				}
     			}
           }
           
  			
  		}
  		
  		//If not all the required fields are set
  		if(requiredFields.length > 0){
  			this.requiredFieldsEvt.fire(requiredFields);			
  			return;
  		}
  		
  		this.addButton.value = inputEx.messages.loadingText;
  		this.addButton.disabled = true;
  		this.itemAddedEvt.fire(record);
  	}
docs: When clicking "Add" button to save a new row