Results 1 to 2 of 2

Thread: Destroy form element before render

  1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    210

    Default Destroy form element before render

    I have a bunch of forms I create that have common elements. Because of this I use functions to create specific fieldsets in the form so its easy to evaluate a couple of variables and spit out the correct form. This is all done before the initial render.

    What I'm running into is on a couple of the forms I need most of the elements created by the function, but not all. How can I destroy the elements created by the function before the form is rendered? I've tried elementName.destroy(); but this doesn't work if the element hasn't been rendered yet. It works fine after, but I get a flicker.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    You could try to remove from the form.items collection before render. Or, you could try adding a fieldClass:'display:none' to those fields - could be an issue if you when you submit and they haven't had a value set.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •