codeathome
31 Aug 2011, 6:40 AM
Hi everyone. I'm new to Ext and am currently checking it out to see if I can use it in my future projects. I'm running into one snag.
I have need to access the HTML DOM created by Ext using an external application. When I set the id parameter of a button, the id is added to the surrounding div element instead of the button itself. This example is taken from examples/form/contact-form.js.
buttons: [{
text: 'Cancel',
handler: function() {
this.up('form').getForm().reset();
this.up('window').hide();
}
}, {
text: 'Send',
id: 'SendButton',
handler: function() {
if (this.up('form').getForm().isValid()) {
// In a real application, this would submit the form to the configured url
// this.up('form').getForm().submit();
this.up('form').getForm().reset();
this.up('window').hide();
Ext.MessageBox.alert('Thank you!', 'Your inquiry has been sent. We will respond as soon as possible.');
}
}
}]
This is the resulting HTML:
<div id="SendButton" class="x-btn x-box-item x-toolbar-item x-btn-default-small x-noicon x-btn-noicon x-btn-default-small-noicon" style="margin-left: 0px; margin-bottom: 0px; margin-right: 0px; margin-top: 0px; width: 75px; left: 301px; top: 0px; ">
<em class id="ext-gen1061">
<button type="button" hidefocus="true" role="button" autocomplete="off" id="ext-gen1060" style="width: 69px; ">
<span class="x-btn-inner" style="width: 69px; " id="ext-gen1062">Send</span>
<span class="x-btn-icon" id="ext-gen1063"></span>
</button>
</em>
</div>
Is there a way to get Ext to put that id into the <button> tag instead?
I have need to access the HTML DOM created by Ext using an external application. When I set the id parameter of a button, the id is added to the surrounding div element instead of the button itself. This example is taken from examples/form/contact-form.js.
buttons: [{
text: 'Cancel',
handler: function() {
this.up('form').getForm().reset();
this.up('window').hide();
}
}, {
text: 'Send',
id: 'SendButton',
handler: function() {
if (this.up('form').getForm().isValid()) {
// In a real application, this would submit the form to the configured url
// this.up('form').getForm().submit();
this.up('form').getForm().reset();
this.up('window').hide();
Ext.MessageBox.alert('Thank you!', 'Your inquiry has been sent. We will respond as soon as possible.');
}
}
}]
This is the resulting HTML:
<div id="SendButton" class="x-btn x-box-item x-toolbar-item x-btn-default-small x-noicon x-btn-noicon x-btn-default-small-noicon" style="margin-left: 0px; margin-bottom: 0px; margin-right: 0px; margin-top: 0px; width: 75px; left: 301px; top: 0px; ">
<em class id="ext-gen1061">
<button type="button" hidefocus="true" role="button" autocomplete="off" id="ext-gen1060" style="width: 69px; ">
<span class="x-btn-inner" style="width: 69px; " id="ext-gen1062">Send</span>
<span class="x-btn-icon" id="ext-gen1063"></span>
</button>
</em>
</div>
Is there a way to get Ext to put that id into the <button> tag instead?