简体   繁体   中英

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?

Just query the input inside the panel's element.

Here's an example

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM