码迷,mamicode.com
首页 > Web开发 > 详细

ExtJS 5.1 - tabpanel setActiveTab: Uncaught TypeError: c.isFocusable is not a function

时间:2016-01-12 15:27:15      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:

Description

在 ExtJS 5.1 中,使用 tabpanel,用 setActiveTab 来指定激活哪个 tab 的时候抱错:

  Uncaught TypeError: c.isFocusable is not a function

Caused By

这是 ExtJS 5.1 的一个 open issue。

Solution

加上如下代码

 1 Ext.define(‘Override.ComponentQuery‘, {
 2     override : ‘Ext.ComponentQuery‘
 3 }, function() {
 4 
 5     Ext.apply(this.pseudos, {
 6 
 7         focusable : function(cmps) {
 8             var len = cmps.length, results = [], i = 0, c;
 9 
10             for (; i < len; i++) {
11                 c = cmps[i];
12                 // If this is a generally focusable Component (has a focusEl, is
13                 // rendered, enabled and visible)
14                 // then it is currently focusable if focus management is enabled
15                 // or if it is an input field, a button or a menu item
16                 if (c.isFocusable && c.isFocusable()) {
17                     // if (c.isFocusable()) {
18                     results.push(c);
19                 }
20             }
21 
22             return results;
23         },
24 
25     });
26 });

Reference

  • http://stackoverflow.com/questions/28177058/extjs-5-1-0-upgrade-card-layout-issue-within-a-border-layout-viewport

 

ExtJS 5.1 - tabpanel setActiveTab: Uncaught TypeError: c.isFocusable is not a function

标签:

原文地址:http://www.cnblogs.com/yuxiaoqi/p/5124093.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!