View Full Version : help, got a stupid problem
auz0bgd
10 Dec 2007, 6:55 AM
hi guys, im new here, and new to ext, i want to to transform an existing submit button in my form with ext on ready func. i have transformed my comboBoxes but dunno how to do that for a button. her's the code:
var searchButton = new Ext.Button ({
action: 'submit',
apllyTo: 'search',
tooltip: 'search for jobs',
scope: this
});
html code has a div tab with id="seach". What am i doing wrong, or not doing ?
tnx
tryanDLS
10 Dec 2007, 8:30 AM
You misspelled applyTo???
auz0bgd
10 Dec 2007, 8:37 AM
nope i saw it and corrected it but firebug still reports this error:
el.ownerDocument has no properties
insertHtml("beforeend", Object action=submit applyTo=search, "<table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap"><tbody><tr><td class="x-btn-lef...")ext-all-debug.js (line 245)
doInsert("beforeEnd", Object action=submit applyTo=search, [" ", "button"], true)ext-all-debug.js (line 464)
append(Object action=submit applyTo=search, [" ", "button"], true)ext-all-debug.js (line 459)
render(Object action=submit applyTo=search)ext-all-debug.js (line 14844)
Button(Object action=submit applyTo=search, undefined)ext-all-debug.js (line 14783) //problem is here something is undefined
(no name)()JobPage (line 217)
fire()ext-all-debug.js (line 1363)
fireDocReady()ext-all-debug.js (line 1400)
[Break on this error]
tryanDLS
10 Dec 2007, 10:12 AM
Try using renderTo. I think applyTo is looking for more of the existing button structure.
JasonMichael
14 Dec 2007, 11:53 AM
Here's what I did, with 'submit' being the ID of the current button on the form...:
Ext.DomHelper.insertHtml('afterend',Ext.getDom('submit'),"<div id=\'submit-btn\'></div>");
Ext.get('submit-btn').replace(Ext.get('submit'));
var uploadBtn = new Ext.Button( 'submit-btn',{
scope: this
});
uploadBtn.setText('Submit Changes');
uploadBtn.on('click',function (e) {
//alert('clicked');
myForm.submit({ form: '#editform','url' : '/testservice.php'});
});
I don't think 'renderTo' was one of the available methods of the Buttons class...
auz0bgd
15 Dec 2007, 8:12 AM
tnx will try it
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.