Ok this might be an easy question but I think I am missing something obvious. In my Sencha/ExtJS app I am trying to retrieve an ID value from a div as it is randomized, auto-generated by ExtJS. So I’ve been mucking around with Chrome’s Developer Tools to make the queries. Here is what I am currently doing:
handler: function() {
var test = Ext.query("div#foo div.x-panel-body");
// This is what I need to retrieve but since it changes I need the ID
//addInput('ext-gen1059');
addInput(test);
}
here is the relevant markup for the fieldset:
<div id="foo" class=" x-panel x-form-fieldset">
<div class="x-form-fieldset-title" id="ext-gen1078">Add Recipe</div>
<div class="x-panel-body" id="ext-gen1059"> **// this ID is what changes**
Am I missing something obvious in the DOM methods used by ExtJS? Should I be using Ext.get, Ext.query, Ext.select?
Ext.queryreturns an array of (vanilla) DOM elements. All you need is theidproperty: