Results 1 to 8 of 8

Thread: TypeError: Object [object Object] has no method 'getItemId'

  1. #1
    Sencha User nak1's Avatar
    Join Date
    Jan 2008
    Posts
    319
    Answers
    2

    Default Answered: TypeError: Object [object Object] has no method 'getItemId'

    Not sure this is a bug or something that I'm doing on my end, however, I seem to get this error:
    TypeError: Object [object Object] has no method 'getItemId' at [object Object].getKey (http://localhost.yc.com/js/touch_2_0...ug.js:45456:21)

    What happens is I add an custom component to a panel, then I remove it and then go back to add it, when I go to add it that second time, I throw this error.
    No longer a Newbie

  2. So I was finally able to resolve it. The issue was that I named my model with the same name as my object. It didn't seem cause an issue the first time I loaded the object, however, the second time I instantiate it, rather then instantiating the form, it instantiates the model.

    Problem solved!

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449
    Answers
    3997

    Default

    When you add it again, are you creating a new instance? if not then when you remove it are you allowing it to be destroyed?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  4. #3
    Sencha User nak1's Avatar
    Join Date
    Jan 2008
    Posts
    319
    Answers
    2

    Default

    Mitchell,

    I do a remove(item,true), so it should be destroying it, and then when I go to add a new item, I just do an add({xtype:newitem})

    Is there a more ideal way I should be doing this?
    No longer a Newbie

  5. #4
    Sencha User nak1's Avatar
    Join Date
    Jan 2008
    Posts
    319
    Answers
    2

    Default

    Any thoughts as to what is going on here?
    No longer a Newbie

  6. #5
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449
    Answers
    3997

    Default

    So what is the variable that you are executing getItemId on? What is it? A config object or a component?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  7. #6
    Sencha User nak1's Avatar
    Join Date
    Jan 2008
    Posts
    319
    Answers
    2

    Default

    Well, not sure I understand the question. The error seems to be in the initialization of the component within the add() method, deep in the sencha code.
    No longer a Newbie

  8. #7

  9. #8
    Sencha User nak1's Avatar
    Join Date
    Jan 2008
    Posts
    319
    Answers
    2

    Default

    So I was finally able to resolve it. The issue was that I named my model with the same name as my object. It didn't seem cause an issue the first time I loaded the object, however, the second time I instantiate it, rather then instantiating the form, it instantiates the model.

    Problem solved!
    No longer a Newbie

Posting Permissions

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