<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: &quot;Upload Excel&quot;,</div><div>            control: new Ext.create(&#39;Ext.form.Panel&#39;, {</div><div>    <span class="Apple-tab-span" style="white-space:pre">                                </span>title: &#39;Upload a CSV File&#39;,</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: &#39;filefield&#39;,</div>

<div>    <span class="Apple-tab-span" style="white-space:pre">                                        </span>name: &#39;csv&#39;,</div><div>    <span class="Apple-tab-span" style="white-space:pre">                                        </span>fieldLabel: &#39;CSV Upload&#39;,</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: &#39;side&#39;,</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: &#39;Select CSV File&#39;</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: &#39;Upload&#39;,</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(&#39;form&#39;).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: &#39;file-upload.py&#39;,</div><div>    <span class="Apple-tab-span" style="white-space:pre">                                                                </span>waitMsg: &#39;Uploading the CSV File...&#39;,</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(&#39;Success&#39;, &#39;Your csv file &quot;&#39; + o.result.file + &#39;&quot; has been uploaded.&#39;);</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: &quot;Upload CSV File&quot;,</div><div>            // check item options</div>

<div>            group: &quot;newTool&quot;</div><div>        });</div><div>        actions[&quot;upCSV&quot;] = 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 &amp; Regards<div>Smaran Harihar</div>

<br>