Results 1 to 4 of 4

Thread: Object references

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    3
    Vote Rating
    0
      0  

    Question Answered: Object references

    I am new to ExtJS, and there is something basic I'm not getting about object references.

    I have a chart named ChartDog, which is attached to a store and shared with a grid, declared like so:
    var chartDog = Ext.create('widget.panel', { ... the chart itself is working fine.

    so later on if I want to change something on its series (or anything else) I ought to be able to do this:
    ChartDog.series.get('style').stroke = '#f00'; or Ext.Cmp('ChartDog') ...

    but I can't because on ANY reference I get an error like "ChartDog is undefined"....that goes for any local var for any template, etc. Why is everything undefined?

  2. That's because "ChartDog" is not the same named reference as "chartDog". JavaScript is case sensitive.

    Instances of classes should begin with lower case.

    Ext.Cmp is an invalid method.

    Also, do not use static ids for components.

  3. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Answers
    102
    Vote Rating
    87
      0  

    Default

    That's because "ChartDog" is not the same named reference as "chartDog". JavaScript is case sensitive.

    Instances of classes should begin with lower case.

    Ext.Cmp is an invalid method.

    Also, do not use static ids for components.

  4. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Good catch ... thank you.

  5. #4
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Answers
    102
    Vote Rating
    87
      0  

    Default

    Please mark this thread as answered so folks who monitor the forums don't waste time.

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
  •