惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
N
News | PayPal Newsroom
S
Security @ Cisco Blogs
Schneier on Security
Schneier on Security
V
V2EX - 技术
S
Secure Thoughts
W
WeLiveSecurity
Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
S
Securelist
S
Security Archives - TechRepublic
Know Your Adversary
Know Your Adversary
V
Vulnerabilities – Threatpost
Security Latest
Security Latest
Recent Commits to openclaw:main
Recent Commits to openclaw:main
G
GRAHAM CLULEY
H
Hacker News: Front Page
Microsoft Azure Blog
Microsoft Azure Blog
I
Intezer
Google Online Security Blog
Google Online Security Blog
美团技术团队
阮一峰的网络日志
阮一峰的网络日志
T
The Exploit Database - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Webroot Blog
Webroot Blog
Jina AI
Jina AI
Engineering at Meta
Engineering at Meta
P
Proofpoint News Feed
The Cloudflare Blog
I
InfoQ
L
LangChain Blog
U
Unit 42
P
Proofpoint News Feed
S
Schneier on Security
S
Security Affairs
Y
Y Combinator Blog
T
Tenable Blog
N
News and Events Feed by Topic
MyScale Blog
MyScale Blog
量子位
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
博客园 - 聂微东
D
Darknet – Hacking Tools, Hacker News & Cyber Security
GbyAI
GbyAI
AWS News Blog
AWS News Blog

博客园 - lzb

预排序遍历树算法 新思创:政务办公系统解决方案 OA系统权限分配实现方案【再转】 关于权限设计的探讨 工作流管理系统 Ext-Menu-action禁用 Ext-Menu-日期控件过长 Google-首页效果图-源代码 Ext-Layout Ext-tree Ext-Grid-HttpProxy-分页 JAVASCRIPT-全面理解javascript的Arguments,caller,callee,call,apply JAVASCRIPT-继承 Core/Ext.js 转自JS堂 Core/Ext.extend 从继承说起 转自JS堂 What is the basic thing to keep in mind about forms 修改Eclipse文本文件默认编码 Javascript 原型和继承(Prototypes and Inheritance) Ext-Xml-Grid-汉化、加载
Ext-TabPanel-插件
lzb · 2008-12-17 · via 博客园 - lzb

1 each方法和closable属性从哪里来啊?

each:来自util/MixedCollection.js这个类

closable:是tab也的一个属性,这是true和false,可以看到tab页上有个小X/或者没有

Code

2

new Ext.menu.Menu([])
类关系图:
Observable
  Component
    BaseItem
      Item

用这个类创建对象的,里面传入的类是Ext.menu.Item,一些配置属性和方法Ext.menu.BaseItem实现了。
在我们创建new Ext.menu.Menu([])这个对象的时候,里面可以配置Ext.menu.Item的属性和方法

                    tabs.items.each(function(item){
                        if(item.closable && item != ctxItem){
                            tabs.remove(item);
                        }
                    }
这里的item,来自tabs


下面这是一个Ext.menu.Item对象:
{
                id: tabs.id + '-close-others',
                text: 'Close Other Tabs',       //text这个配置属性来自Ext.menu.Item,但在Ext.menu.BaseItem没有这个配置属性
                handler : function(){
                    tabs.items.each(function(item){
                        if(item.closable && item != ctxItem){
                            tabs.remove(item);
                        }
                    });
                }
            }