Gendaful
Gendaful

Reputation: 5802

Sencha Touch 2 : How to get the values from an HTML input field displayed inside a Panel?

I am displaying an html inside an Ext.Panel using setHtml method. The HTML is as below.

<html>
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname">
</html>

My Panel is

Ext.define('WU.view.Template', {
  extend: 'Ext.Panel',
  alias: 'widget.templateview',
  config: {
    items: [{
      xtype: 'panel',
      id: 'dummyPanel',
    }]
  }
});

I am setting the values inside the controller as below.

Ext.getCmp('dummyPanel').setHtml(html file);

If I want to get the values from the input field 'firstname' , then how to fetch these values?

Upvotes: 1

Views: 1890

Answers (1)

Titouan de Bailleul
Titouan de Bailleul

Reputation: 12959

Just query the input inside the panel's element.

Here's an example

Hope this helps

Upvotes: 3

Related Questions