Dannesart
14 Nov 2011, 8:17 AM
After I've closed a dialog I want to reload my grid.
Grid:
loadGridData: function(companyNo) {
//cache param for future reloads
this.companyNo = companyNo;
var selectedDate = this.getSelectedDate();
var dateFrom = Ext.Date.getFirstDateOfMonth(selectedDate);
// var dateTo = Ext.Date.getLastDateOfMonth(selectedDate);
this.loadStore(companyNo, dateFrom);
// this.loadStore(companyNo, dateFrom, dateTo);
},
showConfirmationDialog: function(empNo) {
var dialog = Ext.create('Intelliplan.Modules.Staffing.BookEmployee.Consultant.Shift.BookingConfirmationDialog',
{
consultantEmpNo: empNo
}
);
// dialog.add();
dialog.show();
},
dialog:
Ext.define('Intelliplan.Modules.Staffing.BookEmployee.Consultant.Shift.BookingConfirmationDialog', {
extend: 'Intelliplan.Modules.Staffing.BookEmployee.Consultant.Shift.BookingConfirmationDialogUi',
consultantEmpNo: undefined,
initComponent: function () {
this.callParent(arguments);
this.defineReferences();
//handlers
this.sendMailDialogButton.on('click', this.onSendMailDialogButtonClick, this);
this.sendSmsDialogButton.on('click', this.onSendSmsDialogButtonClick, this);
this.clearConfirmationNeedButton.on('click', this.onClearConfirmationNeedButtonClick, this);
this.emailConfirmation.on('emailConfirmationSent', this.onEmailConfirmationSent, this);
this.smsConfirmation.on('smsConfirmationSent', this.onSmsConfirmationSent, this);
this.bookShiftGrid.on('selectedRestransKeysChanged', this.onSelectedRestransKeysChanged, this, {buffer: 2000});
},
defineReferences: function() {
this.emailConfirmation = this.down('#emailConfirmation');
this.sendMailDialogButton = this.down('#sendMailDialogButton');
this.bookShiftGrid = this.down('#bookShiftGrid');
this.smsConfirmation = this.down('#smsConfirmation');
this.sendSmsDialogButton = this.down('#sendSmsDialogButton');
this.clearConfirmationNeedButton = this.down('#clearConfirmationNeedButton');
this.getBottomToolbar().cancelButton = this.getBottomToolbar().down('#cancelButton');
},
onCancelButtonClick: function() {
this.close();
},
onSendMailDialogButtonClick: function () {
if (!this.bookShiftGrid.checkRowIsSelected())
return;
// var data = {
// empNo: this.consultantEmpNo,
// resTransKeys: this.bookShiftGrid.selectedResTransKeys
// };
this.emailConfirmation.sendEmailConfirmation(this.bookShiftGrid.selectedResTransKeys);
},
onSendSmsDialogButtonClick: function () {
if (!this.bookShiftGrid.checkRowIsSelected())
return;
// var data = {
// empNo: this.consultantEmpNo,
// resTransKeys: this.bookShiftGrid.selectedResTransKeys
// };
this.smsConfirmation.sendSmsConfirmation(this.bookShiftGrid.selectedResTransKeys);
},
onEmailConfirmationSent: function() {
this.refreshBookShiftGrid();
},
onSmsConfirmationSent: function() {
this.refreshBookShiftGrid();
},
onClearConfirmationNeedButtonClick: function() {
if (!this.bookShiftGrid.checkRowIsSelected())
return;
var url = Intelliplan.Api.BaseUrl + '/Staffing/ConsultantConfirmation/DeleteConfirmationNeed'
var data = {
empNo: this.consultantEmpNo,
resTransKeys: this.bookShiftGrid.selectedResTransKeys
};
var errorMessage = IPtranslate('Intelliplan.Common.Messaging.Mail.Standard.TemplateGenerationErrorMessage');
Intelliplan.Util.Ajax.post(url, data, true, function() {
this.refreshBookShiftGrid();
}, errorMessage, this);
},
refreshBookShiftGrid: function() {
this.bookShiftGrid.loadStore();
this.bookShiftGrid.view.refresh();
},
onSelectedRestransKeysChanged: function() {
// var data = {
// empNo: this.consultantEmpNo,
// resTransKeys: this.bookShiftGrid.selectedResTransKeys
// };
this.smsConfirmation.generateReportChange(this.bookShiftGrid.selectedResTransKeys);
this.emailConfirmation.generateReportChange(this.bookShiftGrid.selectedResTransKeys);
}
});
any Ideas?
Grid:
loadGridData: function(companyNo) {
//cache param for future reloads
this.companyNo = companyNo;
var selectedDate = this.getSelectedDate();
var dateFrom = Ext.Date.getFirstDateOfMonth(selectedDate);
// var dateTo = Ext.Date.getLastDateOfMonth(selectedDate);
this.loadStore(companyNo, dateFrom);
// this.loadStore(companyNo, dateFrom, dateTo);
},
showConfirmationDialog: function(empNo) {
var dialog = Ext.create('Intelliplan.Modules.Staffing.BookEmployee.Consultant.Shift.BookingConfirmationDialog',
{
consultantEmpNo: empNo
}
);
// dialog.add();
dialog.show();
},
dialog:
Ext.define('Intelliplan.Modules.Staffing.BookEmployee.Consultant.Shift.BookingConfirmationDialog', {
extend: 'Intelliplan.Modules.Staffing.BookEmployee.Consultant.Shift.BookingConfirmationDialogUi',
consultantEmpNo: undefined,
initComponent: function () {
this.callParent(arguments);
this.defineReferences();
//handlers
this.sendMailDialogButton.on('click', this.onSendMailDialogButtonClick, this);
this.sendSmsDialogButton.on('click', this.onSendSmsDialogButtonClick, this);
this.clearConfirmationNeedButton.on('click', this.onClearConfirmationNeedButtonClick, this);
this.emailConfirmation.on('emailConfirmationSent', this.onEmailConfirmationSent, this);
this.smsConfirmation.on('smsConfirmationSent', this.onSmsConfirmationSent, this);
this.bookShiftGrid.on('selectedRestransKeysChanged', this.onSelectedRestransKeysChanged, this, {buffer: 2000});
},
defineReferences: function() {
this.emailConfirmation = this.down('#emailConfirmation');
this.sendMailDialogButton = this.down('#sendMailDialogButton');
this.bookShiftGrid = this.down('#bookShiftGrid');
this.smsConfirmation = this.down('#smsConfirmation');
this.sendSmsDialogButton = this.down('#sendSmsDialogButton');
this.clearConfirmationNeedButton = this.down('#clearConfirmationNeedButton');
this.getBottomToolbar().cancelButton = this.getBottomToolbar().down('#cancelButton');
},
onCancelButtonClick: function() {
this.close();
},
onSendMailDialogButtonClick: function () {
if (!this.bookShiftGrid.checkRowIsSelected())
return;
// var data = {
// empNo: this.consultantEmpNo,
// resTransKeys: this.bookShiftGrid.selectedResTransKeys
// };
this.emailConfirmation.sendEmailConfirmation(this.bookShiftGrid.selectedResTransKeys);
},
onSendSmsDialogButtonClick: function () {
if (!this.bookShiftGrid.checkRowIsSelected())
return;
// var data = {
// empNo: this.consultantEmpNo,
// resTransKeys: this.bookShiftGrid.selectedResTransKeys
// };
this.smsConfirmation.sendSmsConfirmation(this.bookShiftGrid.selectedResTransKeys);
},
onEmailConfirmationSent: function() {
this.refreshBookShiftGrid();
},
onSmsConfirmationSent: function() {
this.refreshBookShiftGrid();
},
onClearConfirmationNeedButtonClick: function() {
if (!this.bookShiftGrid.checkRowIsSelected())
return;
var url = Intelliplan.Api.BaseUrl + '/Staffing/ConsultantConfirmation/DeleteConfirmationNeed'
var data = {
empNo: this.consultantEmpNo,
resTransKeys: this.bookShiftGrid.selectedResTransKeys
};
var errorMessage = IPtranslate('Intelliplan.Common.Messaging.Mail.Standard.TemplateGenerationErrorMessage');
Intelliplan.Util.Ajax.post(url, data, true, function() {
this.refreshBookShiftGrid();
}, errorMessage, this);
},
refreshBookShiftGrid: function() {
this.bookShiftGrid.loadStore();
this.bookShiftGrid.view.refresh();
},
onSelectedRestransKeysChanged: function() {
// var data = {
// empNo: this.consultantEmpNo,
// resTransKeys: this.bookShiftGrid.selectedResTransKeys
// };
this.smsConfirmation.generateReportChange(this.bookShiftGrid.selectedResTransKeys);
this.emailConfirmation.generateReportChange(this.bookShiftGrid.selectedResTransKeys);
}
});
any Ideas?