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

推荐订阅源

博客园_首页
Vercel News
Vercel News
月光博客
月光博客
S
SegmentFault 最新的问题
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
U
Unit 42
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
小众软件
小众软件
WordPress大学
WordPress大学
G
Google Developers Blog
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
博客园 - 【当耐特】
I
InfoQ

博客园 - ◎寶☆呗

Sharepoint 自定义字段(栏) 动态获取数据 Sharepoint 工具使用总结 Sharepoint 内存泄漏 检测工具+-- winform Tab键循序 小发现 instsrv.exe——来自Windows 2000 Resource Kits的一个小工具 [转载]MOSS 2007 SP1 stsadm 194 条指令 (用命令行部署infopath Form )Deploy administrator-approved form templates using command line sharepoint计时器(定时发邮件) Infopath开发经验(xml数据) 基本活动:CodeActivity Creating a Custom SharePoint 2007 List Definition 通过Sharepoint扩展的Webserives来获取某一权限是是否存在 Create a New SharePoint Permission Level and Bind it to an Existing SharePoint Group 执行带返回参数的存储过程 Sorry.....Sorry..... 操作Infopath中的XMl C#编程规范<二> C#代码规范. 工作需要养成的习惯(个人经验)
Extjs 中的tbar中的事件
◎寶☆呗 · 2010-05-10 · via 博客园 - ◎寶☆呗

先上一段代码:

 <script type="text/javascript">
 function clickSave()
 {
  alert('保存事件');
 }

 function confirmCancle()
 {
  alert('确认是否取消');
 }


    </script>

<script type="text/javascript">

 Ext.onReady(function(){

        Ext.QuickTips.init();
        var viewport = new Ext.Viewport({
            layout:'border',
            items:[
               {
                region:'center',
                margins:'1 5 5 5',
                title:'定单管理',
                layout:'fit',
                autoScroll:true,
                items : [{contentEl:'content',
                bodyStyle: "background-color:#DFE8F6;padding:10 0 10 10",
                border:false
              }],

         tbar:[
          {
              text:'保存',
               iconCls: save,
               hander:clickSave(),
                scope:this
           },'-',
            {
              text:'取消',
               iconCls: 'sanCancle',
               handler: function(){
                 confirmCancle();
              },scope:this
           }]

   });

</script>

我们来看一下在tbar中有2个函数,clickSave() 和confirmCancle(),当我们执行的时候,你会发现,这两个事件是在不同的时候执行,

clickSave在我们的页面加载的时候就会执行。

confirmCancle在我们单击了取消事件时才会执行。。

在Extjs中我还没有去仔细查找这是为什么。。。现在只是知道这2种写法会导致不同的结果产生。。

希望对遇到同样问题的人有帮助。。