I have an array of forms, which i create dynamically, and in each form i have a destroy button to destroy the entire form. How do i refer the parent form from the button handler function without actually using the form variable name.
For example;
var forms=new Array();
//whenever i click a button i create a new form.
forms[i] = new Ext.form.Form({}); Part 2: Out of the Box Dojo:: When the button is clicked the funtion helloPressed will be called. 50 /> Text loaded at: <span id=boxLoadTime>N/A</span> </form> </body> </html> http://dojotoolkit.org/book/export/html/124HOME | Transcript:: Use the binaryDecode function to convert binary data into a form that can be Moving the mouse before the mouse button is released does not affect the value http://www.altuit.com/webs/altuit2/Transcript/Function.htmHOME |
//
blah blah blah
//
form[i].render();
now i have an ext.button in each of these forms which is supposed to be the form destroyer. i have function which can be called like 'form.destroy()',
new Ext.Button(null,{
text: 'Remove',
handler: function(){
this.'formhandler'.destroy(); //here how do refer to the parent form of the button?
}
})
The button doesn't have any knowledge of it's containing widget. You could just add a ref as a property of the button.
new Ext.Button(null,{
text: 'Remove',
parentForm:forms[i],
handler: function(){
parentForm.destroy(); //here how do refer to the parent form of the button?
}
thanks for the quick reply ryan. I tried what you said but it gives me an error saying 'parentForm is not defined'. here is my code; I dont understand where it is going haywire
Get Smart About Monitoring Virtual Machines
Microsoft Gets Ex-Streamly Cozy with U.K.'s MediaWave
|