Skip to content

Commit

Permalink
Cleanup dirty record when editor window is closed with close tool in …
Browse files Browse the repository at this point in the history
…panel header.
  • Loading branch information
gsidler committed Mar 10, 2015
1 parent 620045e commit 1b8e368
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/calendar/form/EventWindow.js
Expand Up @@ -66,6 +66,7 @@ Ext.define('Extensible.calendar.form.EventWindow', {

// General configs
closeAction: 'hide',
closable: false,
modal: false,
resizable: false,
constrain: true,
Expand All @@ -77,7 +78,18 @@ Ext.define('Extensible.calendar.form.EventWindow', {
formPanelConfig: {
border: false
},


/**
* Add close tool to panel header. When closing the editor it is important to cleanup the record if dirty.
* Handle it the same way as the cancel button.
*/
tools: [{
type:'close',
handler: function(evt, el, header){
header.ownerCt.onCancel();
}
}],

/**
* @cfg {Boolean} allowDefaultAdd
* @since 1.6.0
Expand Down

0 comments on commit 1b8e368

Please sign in to comment.