Skip to content

Instantly share code, notes, and snippets.

@veriojon
Created March 2, 2011 20:08
Show Gist options
  • Save veriojon/851637 to your computer and use it in GitHub Desktop.
Save veriojon/851637 to your computer and use it in GitHub Desktop.
box with panel
var ExcelErrorDialog = Ext.extend(Ext.Window, {
constructor: function(config) {
this.importerrorForm = new Ext.FormPanel({
frame: true,
bodyStyle: 'padding: 10px 10px 0 10px;',
labelWidth: 50,
defaults: { anchor: '95%', allowBlank: false, msgTarget: 'side'},
// items: [{
// xtype: 'displayfield',
// itemID: 'numerrors',
// value: '# Errors in Imported File: ' + config.num_error
// },{
// xtype: 'textarea',
// itemID: 'errors',
// height: 250,
// value: config.err_string
// }]
});
Ext.apply(this, {
title: 'Excel Import Errors',
layout:'fit',
width:450,
height:400,
plain: true,
modal: true,
items: [this.importerrorForm],
fbar: [
{text: 'Cancel', tabIndex: 5, handler: this.onCancel, scope: this },
{text: 'Download Errors', tabIndex: 4, handler: function() {this.onDownload(config.filename)}, scope: this }
]
});
ExcelErrorDialog.superclass.constructor.apply(this, arguments);
},
onCancel: function() {
this.close();
},
onDownload: function(filename) {
this.hide();
myfilename = "shared/excel/"+filename;
window.open(myfilename);
},
displayReport: function(validate_num, validate_errors, duplicate_num, duplicate_errors) {
if (validate_num > 0) {
this.importerrorForm.add(new Ext.form.DisplayField({
itemId: 'num_validate',
value: validate_num + ' Validation error(s)'
}));
this.importerrorForm.add(new Ext.form.Panel({
itemId: 'err_validate',
autoscroll: true,
html: validate_errors
}));
}
if (duplicate_num > 0) {
this.importerrorForm.add(new Ext.form.DisplayField({
itemId: 'num_duplicate',
value: duplicate_num + ' Duplicate SSID error(s)'
}));
}
this.show();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment