Results 1 to 8 of 8

Thread: Form inside Window problem

  1. #1

    Default Form inside Window problem

    hi to all

    i'm having some hard time to find the solution for this.

    Code:
    new Ext.Window({
     id:'window_novo_contacto'
    ,title:'Novo Contacto'
    ,layout:'fit'
    ,autoWidth:true
    ,closable:true
    ,border:false
    ,hideMode:'offsets'
    ,deferredRender:false
    ,autoDestroy: false
    ,items: [contacto_form]
    }).show()
    where contacto_form is a very simple form.

    my problem is that it works first time but when close and re-open the window, form don't show up.

    i have a similar problem with tabs and tried to solved it in the same way but nothing appears to work. i do believe that it have a very easy solution...i simple can't find it

    tks

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    conctacto_form should be a configuration object.
    Else, you'll need to use a singleton.

  3. #3

    Default

    is it possible to explain it in english? :P cuz now im confused

  4. #4
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    contacto_form should be something like:
    Code:
    var contacto_form =  {
         xtype : 'form',
         items : [ ... formpanel items ... ]
    }
    instead of
    Code:
    var contacto_form = new Ext.form.FormPanel();
    you are getting bit by not knowing about the container model and some object oriented principles.

    See this screencast for more details:
    http://tdg-i.com/58/ext-js-screencas...add-and-remove

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Or use closeAction: 'hide', and just reshow the same Window next time.

  6. #6

    Default

    jgarcia & animal: tks for your answer.both have been my salvation more then once already

    jgarcia: your solution worked!many tks!

    animal: that was exactly what i was trying to achieve! tried with autoDestroy:false but no success. tried your solution first but the behavior is very weird! window is only closed first time. when re-open 2 things hapen:

    • if form not a config object window is opened very very small(only window title width) and is not possible to close it again...
    • if form is a config object window is opened and add the form fields to the already existing ones.again is not possible to close it...
    very weird behavior ...

  7. #7
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    What do the docs for autoDestroy say?

    Read the docs for closeAction.

  8. #8

    Default

    tks...will do that

Posting Permissions

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