Results 1 to 4 of 4

Thread: How to reset a combobox that isFormField=false

  1. #1

    Default How to reset a combobox that isFormField=false

    Hi all,
    I have an Ext.form.Panel. Inside this Panel I have a combobox.

    This combobox is not member of the form

    PHP Code:
    initComponent:           function() {

                           
    this.down('combobox').isFormField false;
    }, 


    All other fields are formfields.I have a button where I reset the formular

    PHP Code:
    formPanel.getForm().reset(); 


    It works fine for all formfields naturally not for my combobox.
    But I have to reset the combobox too. I can set any value too but where I can find my originalValue of the combobox?

    Thanks in advance

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006
    Answers
    5

    Default

    Hello there- I have shared this issue with the support team and asked that they reach out to you to provide some assistance. Your patience is greatly appreciated!

    Thanks,

    Michele

  3. #3
    Sencha MVP Team Member
    Join Date
    Sep 2016
    Location
    Kennewick, WA
    Posts
    150
    Answers
    15

    Default

    On the change event you could do something like this

    Code:
    listeners: {
      change: function (this, newValue, oldValue, eOpts) {
        someVar = oldValue;
    }
    Then when resetting the form expand the function to set the selected item back to someVar.

  4. #4
    Sencha User
    Join Date
    Oct 2018
    Location
    Noida
    Posts
    56
    Answers
    10

    Default

    Hi,

    you can call combobox's reset function on button click it will do the job. Reset function by default sets the original value of the field.
    You can check below fiddle for more reference -
    https://fiddle.sencha.com/#view/editor&fiddle/2ocq

    Hope that will help!

Similar Threads

  1. [OPEN] not able to reset the numberfield with allowBlank:false
    By hjoy in forum Ext JS 6.x Bugs
    Replies: 1
    Last Post: 18 Feb 2016, 6:52 AM
  2. Reset isDirty to false over ExtJS window
    By Pravin.Pawar in forum Ext: Q&A
    Replies: 4
    Last Post: 21 Feb 2013, 6:01 AM
  3. Replies: 0
    Last Post: 8 Jan 2008, 1:10 AM
  4. Replies: 13
    Last Post: 25 Oct 2007, 11:47 AM
  5. Replies: 0
    Last Post: 20 Aug 2007, 11:41 AM

Tags for this Thread

Posting Permissions

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