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: &quot;Upload Excel&quot;,</div><div>    handler: function () {</div><div>        alert(&quot;This will help upload the excel&quot;);</div><div>    },</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>}),</div>

<div>    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>-- <br>Thanks &amp; Regards<div>Smaran Harihar</div><br>
</div>