Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup dirty record when editor window is closed with close tool in panel header #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/calendar/form/EventWindow.js
Original file line number Diff line number Diff line change
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