code: function() {
  		var record, newvalues;
  		
  		// Validate the Form
  	  	if ( !this.dialog.getForm().validate() ) return ;
  	
  		// Insert a new row
        this.datatable.addRow({});
  
  		// Set the Selected Record
  		var rowIndex = this.datatable.getRecordSet().getLength() - 1;
  		this.selectedRecord = rowIndex;
  		
  		// Update the row
  		newvalues = this.dialog.getValue();
  		this.datatable.updateRow( this.selectedRecord , newvalues );
  		
  		// Get the new record
  		record = this.datatable.getRecord(this.selectedRecord);
  					
  		// Fire the add event
        this.itemAddedEvt.fire(record);
  		
  		// Hide the dialog 
        this.dialog.hide();
     }
docs: When saving the Dialog (option insertWithDialog)