⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 samplescripts.debug.js

📁 经典编程900例(C语言),主要是C基础知识
💻 JS
📖 第 1 页 / 共 5 页
字号:
        ExtClass.fly('info').dom.value = Ext.MessageBox.INFO;
        ExtClass.fly('question').dom.value = Ext.MessageBox.QUESTION;
        ExtClass.fly('warning').dom.value = Ext.MessageBox.WARNING;
        ExtClass.fly('error').dom.value = Ext.MessageBox.ERROR;
        ExtClass.get('mb9').on('click', Delegate.create(this, function() {
            Ext.MessageBox.show({ title: 'Icon Support', msg: 'Here is a message with an icon!', buttons: Ext.MessageBox.OK, animEl: 'mb9', fn: Delegate.create(null, SampleScripts.messagebox.MessageBoxScript._showResult), icon: ExtClass.get('icons').dom.value });
        }));
    }
}


Type.createNamespace('SampleScripts.panel');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.panel.PanelScript

SampleScripts.panel.PanelScript = function SampleScripts_panel_PanelScript() {
}
SampleScripts.panel.PanelScript.main = function SampleScripts_panel_PanelScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.panel.PanelScript().init();
    }));
}
SampleScripts.panel.PanelScript.prototype = {
    
    init: function SampleScripts_panel_PanelScript$init() {
        new Ext.Panel(new Ext.PanelConfig().title('My Panel').collapsible(true).renderTo(document.body).width(400).html(SampleScripts.panel.PanelScript._html).toDictionary());
    }
}


Type.createNamespace('SampleScripts');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.SamplePanel

SampleScripts.SamplePanel = function SampleScripts_SamplePanel(config) {
    SampleScripts.SamplePanel.constructBase(this, [ config ]);
}
SampleScripts.SamplePanel.prototype = {
    autoHeight: true,
    frame: true,
    collapsible: true,
    cls: 'demos',
    
    afterRender: function SampleScripts_SamplePanel$afterRender() {
        eval('SampleScripts.SamplePanel.superclass.afterRender.call(this);');
        SampleScripts.SamplePanel.tpl.overwrite(this.body, this);
    }
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.DefaultScript

SampleScripts.DefaultScript = function SampleScripts_DefaultScript() {
}
SampleScripts.DefaultScript.main = function SampleScripts_DefaultScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.DefaultScript().init();
    }));
}
SampleScripts.DefaultScript.prototype = {
    
    init: function SampleScripts_DefaultScript$init() {
        var catalog = [ { title: 'Grids', samples: [ { text: 'Basic Array Grid', url: 'grid/array-grid.aspx', icon: 'grid-array.gif' }, { text: 'Editable Grid', url: 'grid/edit-grid.aspx', icon: 'grid-edit.gif' }, { text: 'XML Grid', url: 'grid/xml-grid.aspx', icon: 'grid-xml.gif' }, { text: 'Paging', url: 'grid/paging.aspx', icon: 'grid-paging.gif' }, { text: 'Grouping', url: 'grid/grouping.aspx', icon: 'grid-grouping.gif' }, { text: 'Live Group Summary', url: 'grid/totals.aspx', icon: 'grid-summary.gif' }, { text: 'Customizing: Grid Plugins', url: 'grid/grid3.aspx', icon: 'grid-plugins.gif' } ] }, { title: 'Tabs', samples: [ { text: 'Basic Tabs', url: 'tabs/tabs.aspx', icon: 'tabs.gif' }, { text: 'Advanced Tabs', url: 'tabs/tabs-adv.aspx', icon: 'tabs-adv.gif' } ] }, { title: 'Windows', samples: [ { text: 'Hello World', url: 'window/hello.aspx', icon: 'window.gif' }, { text: 'MessageBox', url: 'message-box/msg-box.aspx', icon: 'msg-box.gif' } ] }, { title: 'Trees', samples: [ { text: 'Drag and Drop Reordering', url: 'tree/reorder.aspx', icon: 'tree-reorder.gif' }, { text: 'Multiple trees', url: 'tree/two-trees.aspx', icon: 'tree-two.gif' }, { text: 'Customizing: Column Tree', url: 'tree/column-tree.aspx', icon: 'tree-columns.gif' } ] }, { title: 'Layout Managers', samples: [ { text: 'Border Layout', url: 'layout/complex.aspx', icon: 'border-layout.gif' }, { text: 'Anchor Layout', url: 'form/anchoring.aspx', icon: 'anchor.gif' }, { text: 'Customizing: Portals', url: 'layout/portal.aspx', icon: 'portal.gif' } ] }, { title: 'ComboBox', samples: [ { text: 'Basic ComboBox', url: 'form/combos.aspx', icon: 'combo.gif' }, { text: 'Customizing: ComboBox Templates', url: 'form/forum-search.aspx', icon: 'combo-custom.gif' } ] }, { title: 'Forms', samples: [ { text: 'Dynamic Forms', url: 'form/dynamic.aspx', icon: 'form-dynamic.gif' }, { text: 'Ajax with XML Forms', url: 'form/xml-form.aspx', icon: 'form-xml.gif' }, { text: 'Customizing: Search Field', url: 'form/custom.aspx', icon: 'form-custom.gif' } ] }, { title: 'Toolbars and Menus', samples: [ { text: 'Basic Toolbar', url: 'menu/menus.aspx', icon: 'toolbar.gif' }, { text: 'Ext Actions', url: 'menu/actions.aspx', icon: 'toolbar-actions.gif' } ] }, { title: 'Miscellaneous', samples: [ { text: 'DataView', url: 'view/data-view.aspx', icon: 'data-view.gif' }, { text: 'Progress Bar', url: 'simple-widgets/progress-bar.aspx', icon: 'progress.gif' }, { text: 'Templates', url: 'core/templates.aspx', icon: 'templates.gif' }, { text: 'Panels', url: 'panel/panels.aspx', icon: 'panel.gif' }, { text: 'Resizable', url: 'resizable/basic.aspx', icon: 'resizable.gif' } ] } ];
        for (var i = 0; i < catalog.length; i++) {
            var c = catalog[i];
            c['id'] = 'sample-' + i;
            new SampleScripts.SamplePanel(c).render('all-demos');
        }
        var tpl = new Ext.XTemplate('<dl><tpl for=\".\"><dt><a href=\"#{id}\">{title:stripTags}</a></dt></tpl></dl>');
        tpl.overwrite('demo-menu', catalog);
        ExtClass.select('#sample-spacer').remove();
        ExtClass.get('loading').fadeOut({ remove: true });
    }
}


Type.createNamespace('SampleScripts.resizable');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.resizable.BasicScript

SampleScripts.resizable.BasicScript = function SampleScripts_resizable_BasicScript() {
}
SampleScripts.resizable.BasicScript.main = function SampleScripts_resizable_BasicScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.resizable.BasicScript().init();
    }));
}
SampleScripts.resizable.BasicScript.prototype = {
    
    init: function SampleScripts_resizable_BasicScript$init() {
        new Ext.Resizable('basic', new Ext.ResizableConfig().width(200).height(100).minWidth(100).minHeight(50).toDictionary());
        new Ext.Resizable('animated', new Ext.ResizableConfig().width(200).pinned(true).height(100).minWidth(100).minHeight(50).animate(true).easing('backIn').custom('duration', 0.6).toDictionary());
        new Ext.Resizable('wrapped', new Ext.ResizableConfig().wrap(true).pinned(true).minWidth(50).minHeight(50).preserveRatio(true).toDictionary());
        new Ext.Resizable('transparent', new Ext.ResizableConfig().wrap(true).minWidth(50).minHeight(50).preserveRatio(true).transparent(true).toDictionary());
        var custom = new Ext.Resizable('custom', new Ext.ResizableConfig().wrap(true).pinned(true).minWidth(50).minHeight(50).preserveRatio(true).handles('all').draggable(true).dynamic(true).toDictionary());
        var customEl = custom.getEl();
        document.body.insertBefore(customEl.dom, document.body.firstChild);
        customEl.on('dblclick', Delegate.create(this, function() {
            customEl.hide(true);
        }));
        customEl.hide();
        ExtClass.get('showMe').on('click', Delegate.create(this, function() {
            customEl.center();
            customEl.show(true);
        }));
        new Ext.Resizable('dwrapped', new Ext.ResizableConfig().wrap(true).pinned(true).width(450).height(150).minWidth(200).minHeight(50).dynamic(true).toDictionary());
        new Ext.Resizable('snap', new Ext.ResizableConfig().wrap(true).width(250).height(100).handles('e').widthIncrement(50).minWidth(500).dynamic(true).toDictionary());
    }
}


Type.createNamespace('SampleScripts.simple_widgets');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.simple_widgets.ProgressBarScript

SampleScripts.simple_widgets.ProgressBarScript = function SampleScripts_simple_widgets_ProgressBarScript() {
}
SampleScripts.simple_widgets.ProgressBarScript.main = function SampleScripts_simple_widgets_ProgressBarScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.simple_widgets.ProgressBarScript().init();
    }));
}
SampleScripts.simple_widgets.ProgressBarScript.prototype = {
    
    init: function SampleScripts_simple_widgets_ProgressBarScript$init() {
        var pbar1 = new Ext.ProgressBar(new Ext.ProgressBarConfig().custom('text', 'Initializing...').toDictionary());
        var btn1 = ExtClass.get('btn1');
        btn1.on('click', Delegate.create(this, function() {
            ExtClass.fly('p1text').update('Working');
            if (!pbar1.rendered) {
                pbar1.render('p1');
            }
            else {
                pbar1.text = 'Initializing...';
                pbar1.show();
            }
            SampleScripts.simple_widgets._runner.run(pbar1, ExtClass.get('btn1'), 10, Delegate.create(this, function() {
                pbar1.reset(true);
                ExtClass.fly('p1text').update('Done.').show();
            }));
        }));
        var pbar2 = new Ext.ProgressBar(new Ext.ProgressBarConfig().custom('text', 'Ready').id('pbar2').cls('left-align').renderTo('p2').toDictionary());
        var btn2 = ExtClass.get('btn2');
        btn2.on('click', Delegate.create(this, function() {
            SampleScripts.simple_widgets._runner.run(pbar2, btn2, 12, Delegate.create(this, function() {
                pbar2.reset();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -