Results 1 to 4 of 4

Thread: Combobox Field - Add new item - Throws an error

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha Premium Member
    Join Date
    Jul 2013
    Posts
    43

    Default Combobox Field - Add new item - Throws an error

    When adding new item in the combobox store it throws runtime error.

    "Cannot read property 'internalId' of undefined"

    Please follow the following fiddle:
    https://fiddle.sencha.com/#view/editor&fiddle/1n1o

    In this fiddle adding first few items gets succeed, but after that it start throwing an error.

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,255

    Default

    How can I reproduce it? I just typed added 10 items "a" through "j" and it didn't throw any exception.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2013
    Posts
    43

    Default

    There are three things with this,

    1. Try with keywords with space in it. e.g. "Mount Everest", "Mount Rainier" etc. You will see error in console when adding second item and onward.

    Console Error:
    Uncaught TypeError: Cannot read property 'internalId' of undefined
    at constructor.updateIndexes (ext-all-debug.js:167071)
    at constructor.onAdd (ext-all-debug.js:166926)
    at constructor.fire (ext-all-debug.js:20223)
    at constructor.doFireEvent (ext-all-debug.js:21130)
    at constructor.prototype.doFireEvent (ext-all-debug.js:54757)
    at constructor.fireEventArgs (ext-all-debug.js:20983)
    at constructor.fireEvent (ext-all-debug.js:20942)
    at constructor.onCollectionAddItems (ext-all-debug.js:89069)
    at constructor.onCollectionAdd (ext-all-debug.js:89015)
    at constructor.notify (ext-all-debug.js:72131)


    2. When using findBy function to make sure not adding duplicate items, it ended up using "record.get('field1'). Is there any better approach than not using hard coded field reference as "field1"?

    3. Even using "store.insert" and inserting new items at index 0, dropdown shows this item added like at the end of the list.

  4. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,255

    Default

    1) No, I still can't reproduce this using the linked fiddle. I typed "Mount Everest", hit the add button. "Mount Rainier", hit the add button. Repeated with a few other "Mount Foo/Bar/Baz" values and no exception was thrown.

    2) It's because you used an auto generated store. Provide a store with your own fields.

    3) I can't reproduce this either. All new values are added as the first item in the list.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Similar Threads

  1. Replies: 1
    Last Post: 1 Dec 2014, 12:26 PM
  2. Replies: 5
    Last Post: 5 Jun 2012, 9:42 PM
  3. [CLOSED] [4.1b2] Model with field named 'source' throws an error
    By saem in forum Ext:Bugs
    Replies: 1
    Last Post: 27 Jan 2012, 4:05 PM
  4. Replies: 1
    Last Post: 3 Jan 2012, 10:47 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
  •