1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    107
    Vote Rating
    0
    don4321 is on a distinguished road

      0  

    Default How do I remove a combo box

    How do I remove a combo box


    I have something like this:

    PHP Code:
    var cb = new Ext.form.Combox( {
    xtype'combo',
    id'mybox'
    ...
    }); 
    which works just fine. However, in the later flow when the field associated with the combox is no longer used I'd like to destroy the box (it looks like cool effects).
    The attempt of resetting the cb var to null did not help.

    Simply put, it's like this:
    Initially,
    <input type="text" id="title"> {the combox here}
    Later,
    the <input type="text" id="title"> is removed or made invisible, so it now looks like this
    {the combox here}
    and of course the above {the combox here} is unnecessary and it looks bad.

    Could you help? And please let me know if I haven't explained the question clearly.

    Thanks in advance.

  2. #2
    Ext User
    Join Date
    Aug 2009
    Posts
    10
    Vote Rating
    0
    pake007 is on a distinguished road

      0  

    Default


    Maybe you can use the remove() function, if your combobox is on a panel, you can use the code like:

    /*---------------code snippet ------------------
    panel.remove(combobox, true);
    panel.doLayout(true);
    */

    Don't forget to call doLayout, it is important!

  3. #3
    Sencha User
    Join Date
    Jun 2009
    Posts
    107
    Vote Rating
    0
    don4321 is on a distinguished road

      0  

    Default


    Not in the panel. Thanks tho.

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    cb.destroy()?

    ps. I don't fully understand the question. Maybe you need to rephrase it...

Similar Threads

  1. Remove filter in combo box
    By jonathanb in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 15 May 2009, 8:22 AM
  2. [SOLVED] Add/Remove Form fields from combo box
    By LedrickLeron in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 19 Feb 2009, 12:02 PM
  3. [solved] Combo box needs to be displayed as ordinary HTML combo box.
    By Prathima in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 29 Dec 2008, 11:05 PM
  4. Replies: 1
    Last Post: 20 May 2008, 4:22 PM

Thread Participants: 2