code: function(e) {
  
        if(!this.dialog) {
           this.renderDialog();
        }
  		
  		// Inserting new record
  		this.insertNewRecord = true;
  		
  		this.dialog.whenFormAvailable({
  			fn: function() {
  				this.dialog.getForm().clear();
  				this.dialog.show();
  			},
  			scope: this
  		});
  		
     }
docs: Insert button event handler