Forum Discussion
tppegu
14 years agoContributor
A few things I've learned while working with ExtJS apps:
1) Reparenting items and enabling the Extended Find is a very useful approach, but must be used carefully, and even if you do it perfectly it still may not work as well as you'd like. Take care to choose an appropriate parent object, and be sure that you can find that object reliably.
2) Be careful with the "className" property. ExtJS uses this property for all sorts of things, and it changes frequently on some objects. So be sure to thoroughly wildcard this property whenever you use it, and be aware that the value you see in the object browser will often have leading or trailing spaces that you can't see.
3) ExtJS provides a "Name" property on most of the control classes, which is usually not used by developers, but if it is used will go into the ObjectIdentifier field in TC. If you can convince the developers to provide useful names on the important controls, then it makes finding them much, much easier than it is when you're stuck with names like "ext_gen123".
4) Using the various Find methods is often more reliable than name mapping for these controls.
That last one is probably the most significant lesson I've learned. I generally use name mapping to find an ancestor of the object I want, then use FindChild or FindAllChildren to locate the object itself.
1) Reparenting items and enabling the Extended Find is a very useful approach, but must be used carefully, and even if you do it perfectly it still may not work as well as you'd like. Take care to choose an appropriate parent object, and be sure that you can find that object reliably.
2) Be careful with the "className" property. ExtJS uses this property for all sorts of things, and it changes frequently on some objects. So be sure to thoroughly wildcard this property whenever you use it, and be aware that the value you see in the object browser will often have leading or trailing spaces that you can't see.
3) ExtJS provides a "Name" property on most of the control classes, which is usually not used by developers, but if it is used will go into the ObjectIdentifier field in TC. If you can convince the developers to provide useful names on the important controls, then it makes finding them much, much easier than it is when you're stuck with names like "ext_gen123".
4) Using the various Find methods is often more reliable than name mapping for these controls.
That last one is probably the most significant lesson I've learned. I generally use name mapping to find an ancestor of the object I want, then use FindChild or FindAllChildren to locate the object itself.
Related Content
- 4 years agokylegogtp
- 5 years agogdave
- 5 years agoCliffSE
- 9 years agolsainsbury
- 11 months agoḼari