`
xjnine
  • 浏览: 48035 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

关于Extjs中(uncaught exception: No center region defined in BorderLayout)

阅读更多
    最近,在使用Extjs的过程中,偶然遇到一个奇怪的问题 :就是我初始化了一个窗口,在页面上有一个图标,通过Ext.get("").on("click","")方法点击此图标显示此窗口,但是短短的一段代码,在firefox中老是报:uncaught exception: No center region defined in BorderLayout的错,而且无法显示此窗口。
  
     根据IE的错误信息调试了老半天也没找到哪的毛病,本来就没多少的JS代码,硬是不知道问题出在哪。看了Firefox的提示才明白,意思就是说在layout为border的westpanel中没有定义center region。防止这样的报错就得把layout为border删了或者添加center region,显然如果这个panel没有子panel(items)的话完全没必要设成border layout。查了下ExtJS3.1.1 API documentation,关于border layout的提示有:
1.Any container using the BorderLayout must have a child item with region:’center’. The child item in the center region will always be resized to fill the remaining space not used by the other regions in the layout.
2.Any child items with a region of west or east must have width defined (an integer representing the number of pixels that the region should take up).
3.Any child items with a region of north or south must have height defined.
看来做web开发,firefox中的firebug是非常有用的。


分享到:
评论
1 楼 nail2008 2011-03-30  
我在用jBPM的时候,jBPM生成的按钮默认id为id="${leavingTransition.id}_btn",
结果传过来的id是79798_btn,由于form的元素出了问题,简介导致报这个错。
所以,不但要检查form的布局,检查form的元素也很重要。

相关推荐

Global site tag (gtag.js) - Google Analytics