View Full Version : Object references

24 Jan 2012, 7:04 AM
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?

24 Jan 2012, 8:35 AM
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.

24 Jan 2012, 8:51 AM
Good catch ... thank you.

24 Jan 2012, 9:31 AM
:) Please mark this thread as answered so folks who monitor the forums don't waste time.