[Users] Uploading an Excel File using GeoExt

Bart van den Eijnden bartvde at opengeo.org
Tue Oct 2 09:40:57 CEST 2012


Hi,

this is not a question on GeoExt, please use the Sencha forums instead.

Best regards,
Bart

-- 
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers.



On Oct 1, 2012, at 10:20 PM, Smaran Harihar <smaran.harihar at gmail.com> wrote:

> Hi,
> 
> I am new to ExtJS. Can someone guide me on how I should proceed if I wish to upload a excel using button in the Toolbar.
> 
> This is a code that I got from searching but it is not working,
> 
> action = new Ext.Action({
>     text: "Upload Excel",
>     handler: function () {
>         alert("This will help upload the excel");
>     },
>     control: new Ext.create('Ext.form.Panel', {
> 				title: 'Upload a CSV File',
> 				width: 400,
> 				bodyPadding: 10,
> 				frame: true,
> 				renderTo: Ext.getBody(),
> 				items: [{
> 					xtype: 'filefield',
> 					name: 'csv',
> 					fieldLabel: 'CSV Upload',
> 					labelWidth: 50,
> 					msgTarget: 'side',
> 					allowBlank: false,
> 					buttonText: 'Select CSV File'
> 				}],
> 				
> 				buttons: [{
> 					text: 'Upload',
> 					handler	: function() {
> 						var form = this.up('form').getForm();
> 						if(form.isValid()){
> 							form.submit({
> 								url: 'file-upload.py',
> 								waitMsg: 'Uploading the CSV File...',
> 								success: function(fp, o) {
> 									Ext.Msg.alert('Success', 'Your csv file "' + o.result.file + '" has been uploaded.');
> 								}	
> 							});	
> 						}	
> 					}
> 				}]
> 		}),
>     map: map,
>     // button options
>     tooltip: "Upload CSV File",
>     // check item options
>     group: "newTool"
> });
> actions["upCSV"] = action;
> toolbarItems.push(action);
> 
> -- 
> Thanks & Regards
> Smaran Harihar
> 
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20121002/677411f5/attachment.htm 


More information about the Users mailing list