ExtJs最佳做法 [英] ExtJs best practices
问题描述
似乎大多数ExtJS的书籍和ExtJS的介绍都只是关注显示所有好的功能,但是大多数的书籍并没有真正解释如何使用ExtJS来构建稳定的,可维护的布局/应用程序。而且如何编写它们,而不会产生不可读的混乱...
it seems that most ExtJS books and ExtJS introductions just focus on showing all the nice features but most of them don't really explain how to build stable, maintainable layouts / applications with ExtJS. And how to write them without creating an unreadable mess...
我没有具体的应用程序,我只是想知道我如何殴打我的ExtJS码。所以如果你需要一个例子,一个用于项目管理(图书馆)或类似工作板的常规应用程序最好地描述我在想什么。
I've no specific application in mind, I'm just wondering how I can "beatify" my ExtJS code. So if you need an example, a "regular" application for item management (library) or something like a job board would best describe what I was thinking of.
所以可以任何人如果要使用ExtJS为客户端代码构建这些应用程序,请分享一些关于如何构建这些应用程序的良好链接或建议?
So can anyone share some good links or advices on how to structure such applications when I want to build them with ExtJS for the client side code?
提前感谢
干杯
Thanks in advance, Cheers
推荐答案
在我公司的主要代码审查人员执行:
In my company main code reviewer enforcing:
- 作为组件总是与PAPA谈话 - 从来没有给你兄弟姐妹(允许自己的孩子离开)
- 尽量避免冒泡
- 如果你遵循#1你不需要使用Ext.getCmp()它太贵了,所以不要
- 考虑你的团队中别人可以使用的每个组件
- 在命名空间中使用适当的层次结构(并使用命名空间)
- As component always talk to PAPA - never to you sibling (own children offcourse allowed)
- Try to avoid bubblling
- If you follow #1 you do not have need to use Ext.getCmp () it too expensive, so DO NOT
- Consider each component reusable by someone else in your team
- Use proper hierarchy in namespaces (and use namespaces)
仅作为遵循文档顶部的几个主要规则。 ..:)
As only a few main rules on top of follow documentation... :)
这篇关于ExtJs最佳做法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!