zoukankan      html  css  js  c++  java
  • Ext.MessageBox

    Ext.require([
        'Ext.window.MessageBox',
        'Ext.tip.*'
    ]);
    
    Ext.onReady(function(){
    1                         Ext.MessageBox.confirm('确认', '你确定要删除' + empname + '共' + records.length + '条记录吗?', function (e) {
    2                             if (e == "yes") {
    3                                 PersonManage.EmployeeManager.delEmp(empId);
    4                             }
    5                         });
        Ext.get('mb2').on('click', function(e){
            Ext.MessageBox.prompt('Name', 'Please enter your name:', showResultText);
        });
    
        Ext.get('mb3').on('click', function(e){
            Ext.MessageBox.show({
               title: 'Address',
               msg: 'Please enter your address:',
               300,
               buttons: Ext.MessageBox.OKCANCEL,
               multiline: true,
               fn: showResultText,
               animateTarget: 'mb3'
           });
        });
    
        Ext.get('mb4').on('click', function(e){
            Ext.MessageBox.show({
               title:'Save Changes?',
               msg: 'You are closing a tab that has unsaved changes. <br />Would you like to save your changes?',
               buttons: Ext.MessageBox.YESNOCANCEL,
               fn: showResult,
               animateTarget: 'mb4',
               icon: Ext.MessageBox.QUESTION
           });
        });
    
        Ext.get('mb6').on('click', function(){
            Ext.MessageBox.show({
               title: 'Please wait',
               msg: 'Loading items...',
               progressText: 'Initializing...',
               300,
               progress:true,
               closable:false,
               animateTarget: 'mb6'
           });
    
           // this hideous block creates the bogus progress
           var f = function(v){
                return function(){
                    if(v == 12){
                        Ext.MessageBox.hide();
                        Ext.example.msg('Done', 'Your fake items were loaded!');
                    }else{
                        var i = v/11;
                        Ext.MessageBox.updateProgress(i, Math.round(100*i)+'% completed');
                    }
               };
           };
           for(var i = 1; i < 13; i++){
               setTimeout(f(i), i*500);
           }
        });
    
        Ext.get('mb7').on('click', function(){
            Ext.MessageBox.show({
               msg: 'Saving your data, please wait...',
               progressText: 'Saving...',
               300,
               wait:true,
               waitConfig: {interval:200},
               icon:'ext-mb-download', //custom class in msg-box.html
               iconHeight: 50,
               animateTarget: 'mb7'
           });
            setTimeout(function(){
                //This simulates a long-running operation like a database save or XHR call.
                //In real code, this would be in a callback function.
                Ext.MessageBox.hide();
                Ext.example.msg('Done', 'Your fake data was saved!');
            }, 8000);
        });
    
        Ext.get('mb8').on('click', function(){
            Ext.MessageBox.alert('Status', 'Changes saved successfully.', showResult);
        });
    
        //Add these values dynamically so they aren't hard-coded in the html
        Ext.fly('info').dom.value = Ext.MessageBox.INFO;
        Ext.fly('question').dom.value = Ext.MessageBox.QUESTION;
        Ext.fly('warning').dom.value = Ext.MessageBox.WARNING;
        Ext.fly('error').dom.value = Ext.MessageBox.ERROR;
    
        Ext.get('mb9').on('click', function(){
            Ext.MessageBox.show({
               title: 'Icon Support',
               msg: 'Here is a message with an icon!',
               buttons: Ext.MessageBox.OK,
               animateTarget: 'mb9',
               fn: showResult,
               icon: Ext.get('icons').dom.value
           });
        });
    
        Ext.get('mb10').on('click', function(){
            Ext.MessageBox.show({
                title: 'What, really?',
                msg: 'Are you sure?',
                buttons: Ext.MessageBox.YESNO,
                buttonText:{ 
                    yes: "Definitely!", 
                    no: "No chance!" 
                },
                fn: showResult
            });
        });
    
        function showResult(btn){
            Ext.example.msg('Button Click', 'You clicked the {0} button', btn);
        }
    
        function showResultText(btn, text){
            Ext.example.msg('Button Click', 'You clicked the {0} button and entered the text "{1}".', btn, text);
        }
    });
  • 相关阅读:
    linux环境下时区无法设置(UTC无法更改为CST)的问题解决
    SUSE12 网卡配置、SSH远程配置、解决CRT密钥交换失败,没有兼容的加密程序
    SUSE12 操作系统安装
    Unity技术支持团队性能优化经验分享
    基于unity3d游戏的android版本逆向初探
    Unity手游引擎安全解析及实践
    盛大游戏技术总监徐峥:Unity引擎使用的三种方式
    基于Unity 5的次世代卡通渲染技术 -- Unite 2017 米哈游总监贺甲分享实录
    欢乐互娱庞池海:《龙之谷》项目性能优化经验分享
    ue4 htcvivi简单配置
  • 原文地址:https://www.cnblogs.com/Celebrator/p/4494134.html
Copyright © 2011-2022 走看看