Note that there are some explanatory texts on larger screens.

plurals
  1. POextJS events/listeners for newb to js/extjs
    primarykey
    data
    text
    <p>I'm trying to learn a little bit about manipulating UI elements in forms. I have 2 graphical elements. I have a comboBox that has a list of arbitrary things and I have a very basic form panel. what I'm trying to do is pass the contents of a clicked item in the combobox to the input box on the form. Click on 'cat" in combobox then the form will say animal: cat ... I've been trying to add listeners and using the .on approaches to do this but I can't seem to get it. Any advice or hints would be much appreciated. </p> <pre><code> Ext.onReady(function () { // The data store containing the list of cool stuffz var animals = Ext.create('Ext.data.Store', { fields: ['id', 'name'], data: [{ "id": 'cat', "name": "mycat" }, { 'id' : 'dog', "name": "mydog" }, { 'id' : 'sbBarGirls', "name": "heartbreaking-man-eating-deathclaw" } //... ] }); // Create the combo box, attached to the states data store Ext.create('Ext.form.ComboBox', { id: 'combo', width: 600, fieldLabel: 'Choose animal', emptyText: 'dont select the last one', store: animals, queryMode: 'local', displayField: 'name', valueField: 'id', renderTo: Ext.getBody() }); }); </code></pre> <p>//non related code here..</p> <pre><code> Ext.onReady(function(){ Ext.create('Ext.form.Panel', { title: 'Animal sanctuary, one animal per location ', width: 300, bodyPadding: 10, style: 'background-color: #Fdd;', renderTo: Ext.getBody(), items: [{ xtype: 'textfield', fieldLabel: 'animal:', name: 'myanimal' }] }); }); </code></pre> <p>what i was trying to do was use the dom event mousedown on one of the comboselections trigger a listener but i couldn't seem to get it to work, my apologies if the event/listener tags are incorrect.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload