<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>this is not a question on GeoExt, please use the Sencha forums instead.</div><div><br></div><div>Best regards,</div><div>Bart</div><div><br></div><div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>-- <br>Bart van den Eijnden<br>OpenGeo - <a href="http://opengeo.org/">http://opengeo.org</a><br>Expert service straight from the developers.</div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On Oct 1, 2012, at 10:20 PM, Smaran Harihar <<a href="mailto:smaran.harihar@gmail.com">smaran.harihar@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<div><br></div><div>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.</div><div><br></div><div>This is a code that I got from searching but it is not working,</div>
<div><br></div><div><div>action = new Ext.Action({</div><div> text: "Upload Excel",</div><div> handler: function () {</div><div> alert("This will help upload the excel");</div><div> },</div>
<div> control: new Ext.create('Ext.form.Panel', {</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>title: 'Upload a CSV File',</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>width: 400,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>bodyPadding: 10,</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>frame: true,</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>renderTo: Ext.getBody(),</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>items: [{</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>xtype: 'filefield',</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>name: 'csv',</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>fieldLabel: 'CSV Upload',</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>labelWidth: 50,</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>msgTarget: 'side',</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>allowBlank: false,</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>buttonText: 'Select CSV File'</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>}],</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>buttons: [{</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>text: 'Upload',</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>handler<span class="Apple-tab-span" style="white-space:pre">        </span>: function() {</div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span>var form = this.up('form').getForm();</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                </span>if(form.isValid()){</div><div><span class="Apple-tab-span" style="white-space:pre">                                                        </span>form.submit({</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>url: 'file-upload.py',</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>waitMsg: 'Uploading the CSV File...',</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>success: function(fp, o) {</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                                        </span>Ext.Msg.alert('Success', 'Your csv file "' + o.result.file + '" has been uploaded.');</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>}<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                        </span>});<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span>}<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>}]</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}),</div>
<div> map: map,</div><div> // button options</div><div> tooltip: "Upload CSV File",</div><div> // check item options</div><div> group: "newTool"</div><div>});</div><div>actions["upCSV"] = action;</div>
<div>toolbarItems.push(action);</div><div><br></div>-- <br>Thanks & Regards<div>Smaran Harihar</div><br>
</div>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@geoext.org">Users@geoext.org</a><br>http://www.geoext.org/cgi-bin/mailman/listinfo/users<br></blockquote></div><br></div></body></html>