Results 1 to 4 of 4

Thread: Appending to combobox field

  1. #1
    Sencha User
    Join Date
    Jul 2016
    Posts
    38
    Answers
    1

    Default Answered: Appending to combobox field

    hello!!! I have a combobox with a text. When you select the element from the dropdown it must be appended to the field of the combobox but not replaced.

    I've tried this:

    Code:
    beforeselect: function (combo, record) {
           var rawVal = this.rawValue;
                
           ...............
    
    
           record.data.Value = rawVal + record.data.Value;
    },
    But this code adds to the store modified version of record, so it is not what I need. I need store haven't modified.

  2. I've solved this with another way:

    Code:
    beforeselect: function (combo, record) {
            var rawVal = this.rawValue;
            
            .......... some edits ..........
    
    
            combo.fullValue = rawVal + record.data.Value;
    },
    
    select: function (combo, record) {
         combo.setRawValue(combo.fullValue);
    }

  3. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Have you looked into using a Tag field?
    http://docs.sencha.com/extjs/5.1.1/E...field.Tag.html

  4. #3
    Sencha User
    Join Date
    Jul 2016
    Posts
    38
    Answers
    1

    Default

    Yes. But tagfield uses only one type in the store. I want to load the store after every word.
    Example:

    1. inputfield: empty, dropdown: Animal, Trees
    2. enter Animal
    3. inputfield: Animal, dropdown: Wolf, Fox (new loaded data, childs of Animal)
    4. enter Wolf
    5. inputfield: Animal Wolf
    and so on

  5. #4
    Sencha User
    Join Date
    Jul 2016
    Posts
    38
    Answers
    1

    Default

    I've solved this with another way:

    Code:
    beforeselect: function (combo, record) {
            var rawVal = this.rawValue;
            
            .......... some edits ..........
    
    
            combo.fullValue = rawVal + record.data.Value;
    },
    
    select: function (combo, record) {
         combo.setRawValue(combo.fullValue);
    }

Similar Threads

  1. Replies: 2
    Last Post: 19 Mar 2015, 8:44 AM
  2. Appending <DIV> to XTemplate which is used in ComboBOX
    By roshaningole in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 5 Oct 2011, 6:52 AM
  3. Replies: 0
    Last Post: 17 Jun 2011, 1:53 AM
  4. [2.x] Field Override (appending other fields, and displaying help text)
    By Confused in forum Ext 2.x: User Extensions and Plugins
    Replies: 72
    Last Post: 4 Nov 2010, 7:46 AM
  5. Replies: 7
    Last Post: 10 May 2009, 9:40 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
  •