<div>Hi,</div><div><br></div><div>I am trying to create a CSV File upload on GeoExt Map App.</div><div><br></div><div>I need to place the upload function within the Ext.Action, so that I can add it to the toolbar of the GeoExt Panel. I am trying to implement this <a href="http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.File">example</a>. Here is my code,</div>
<div><br></div><div> action = new Ext.Action({</div><div> text: "Upload Excel",</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>}),<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">                </span>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><div>Firebug keeps giving me this error,</div>
<div><br></div><div>`TypeError: b[d.xtype || e] is not a constructor`</div><div><br></div><div>Am I declaring the function incorrectly within the Ext.Action?</div><div><br></div>-- <br>Thanks & Regards<div>Smaran Harihar</div>
<br>