Js: Extensible Calendar Examples

http://ext.ensible.com
https://github.com/bmoeskau/Extensible
https://github.com/TeamupCom/extensible
http://www.rahulsingla.com/sites/default/files/content/blog/extjs-calendar/dynamic-calendars.html
http://ext.ensible.com/deploy/dev/examples/
http://ext.ensible.com/products/calendar/download/choose.php

dynamic-calendars.js:

Ext.ns(‘Ext.ensible.sample‘);

Ext.ensible.sample.CalendarData = {
    "calendars":[{
        "id":1,
        "title":"Home",
        "color":2
    },{
        "id":2,
        "title":"Work",
        "color":22
    },{
        "id":3,
        "title":"School",
        "color":7
    },{
        "id":4,
        "title":"Sports",
        //"hidden":true, // optionally init this calendar as hidden by default
        "color":26
    }]
};

var today = new Date().clearTime();
Ext.ensible.sample.EventData = {
    "evts":[{
        "id":1001,
        "cid":1,
        "title":"Vacation",
        "start":today.add(Date.DAY, -20).add(Date.HOUR, 10),
        "end":today.add(Date.DAY, -10).add(Date.HOUR, 15),
		"notes":"Have fun"
    },{
        "id":1002,
        "cid":2,
        "title":"Lunch with Matt",
        "start":today.add(Date.HOUR, 11).add(Date.MINUTE, 30),
        "end":today.add(Date.HOUR, 13),
        "loc":"Chuy‘s!",
        "url":"http://chuys.com",
		"notes":"Order the queso",
        "rem":"15"
    },{
        "id":1003,
        "cid":3,
        "title":"Project due",
        "start":today.add(Date.HOUR, 15),
        "end":today.add(Date.HOUR, 15)
    },{
        "id":1004,
        "cid":1,
        "title":"Sarah‘s birthday",
        "start":today,
        "end":today,
        "notes":"Need to get a gift",
        "ad":true
    },{
        "id":1005,
        "cid":2,
        "title":"A long one...",
        "start":today.add(Date.DAY, -12),
        "end":today.add(Date.DAY, 10).add(Date.SECOND, -1),
        "ad":true
    },{
        "id":1006,
        "cid":3,
        "title":"School holiday",
        "start":today.add(Date.DAY, 5),
        "end":today.add(Date.DAY, 7).add(Date.SECOND, -1),
        "ad":true,
        "rem":"2880"
    },{
        "id":1007,
        "cid":1,
        "title":"Haircut",
        "start":today.add(Date.HOUR, 9),
        "end":today.add(Date.HOUR, 9).add(Date.MINUTE, 30),
		"notes":"Get cash on the way"
    },{
        "id":1008,
        "cid":3,
        "title":"An old event",
        "start":today.add(Date.DAY, -30),
        "end":today.add(Date.DAY, -28),
        "ad":true
    },{
        "id":1009,
        "cid":2,
        "title":"Board meeting",
        "start":today.add(Date.DAY, -2).add(Date.HOUR, 13),
        "end":today.add(Date.DAY, -2).add(Date.HOUR, 18),
        "loc":"ABC Inc.",
        "rem":"60"
    },{
        "id":1010,
        "cid":3,
        "title":"Jenny‘s final exams",
        "start":today.add(Date.DAY, -2),
        "end":today.add(Date.DAY, 3).add(Date.SECOND, -1),
        "ad":true
    },{
        "id":1011,
        "cid":1,
        "title":"Movie night",
        "start":today.add(Date.DAY, 2).add(Date.HOUR, 19),
        "end":today.add(Date.DAY, 2).add(Date.HOUR, 23),
        "notes":"Don‘t forget the tickets!",
        "rem":"60"
    },{
        "id":1012,
        "cid":4,
        "title":"Gina‘s basketball tournament",
        "start":today.add(Date.DAY, 8).add(Date.HOUR, 8),
        "end":today.add(Date.DAY, 10).add(Date.HOUR, 17)
    },{
        "id":1013,
        "cid":4,
        "title":"Toby‘s soccer game",
        "start":today.add(Date.DAY, 5).add(Date.HOUR, 10),
        "end":today.add(Date.DAY, 5).add(Date.HOUR, 12)
    }]
};

/*
 * A simple reusable store that loads static calendar field definitions into memory
 * and can be bound to the CalendarCombo widget and used for calendar color selection.
 */
Ext.ensible.sample.CalendarStore = Ext.extend(Ext.data.Store, {
    constructor: function(config){
        config = Ext.applyIf(config || {}, {
            storeId: ‘calendarStore‘,
            root: ‘calendars‘,
            idProperty: Ext.ensible.cal.CalendarMappings.CalendarId.mapping || ‘id‘,
            proxy: new Ext.data.MemoryProxy(),
            autoLoad: true,
            fields: Ext.ensible.cal.CalendarRecord.prototype.fields.getRange(),
            sortInfo: {
                field: Ext.ensible.cal.CalendarMappings.Title.name,
                direction: ‘ASC‘
            }
        });
        this.reader = new Ext.data.JsonReader(config);
        Ext.ensible.sample.CalendarStore.superclass.constructor.call(this, config);
    }
});

/*
 * This is a simple in-memory store implementation that is ONLY intended for use with
 * calendar samples running locally in the browser with no external data source. Under
 * normal circumstances, stores that use a MemoryProxy are read-only and intended only
 * for displaying data read from memory. In the case of the calendar, it‘s still quite
 * useful to be able to deal with in-memory data for sample purposes (as many people
 * may not have PHP set up to run locally), but by default, updates will not work since the
 * calendar fully expects all CRUD operations to be supported by the store (and in fact
 * will break, for example, if phantom records are not removed properly). This simple
 * class gives us a convenient way of loading and updating calendar event data in memory,
 * but should NOT be used outside of the local samples.
 *
 * For a real-world store implementation see the remote sample (remote.js).
 */
Ext.ensible.sample.MemoryEventStore = Ext.extend(Ext.data.Store, {
    constructor: function(config){
        config = Ext.applyIf(config || {}, {
            storeId: ‘eventStore‘,
            root: ‘evts‘,
            proxy: new Ext.data.MemoryProxy(),
            writer: new Ext.data.DataWriter(),
            fields: Ext.ensible.cal.EventRecord.prototype.fields.getRange(),
            idProperty: Ext.ensible.cal.EventMappings.EventId.mapping || ‘id‘
        });
        this.reader = new Ext.data.JsonReader(config);
        Ext.ensible.sample.MemoryEventStore.superclass.constructor.call(this, config);
    },

    // In real implementations the store is responsible for committing records
    // after a remote transaction has returned success = true. Since we never do
    // a real transaction, we never get any of the normal store callbacks telling
    // us that an edit occurred. This simple hack works around that for the purposes
    // of the local samples, but should NEVER actually be done in real code.
    afterEdit : function(rec){
        rec.commit();
    },

    listeners: {
        // Since MemoeryProxy has no "create" implementation, added events
        // get stuck as phantoms without an EventId. The calendar does not support
        // batching transactions and expects records to be non-phantoms, so for
        // the purpose of local samples we can hack that into place. In real remote
        // scenarios this is handled automatically by the store, and so you should
        // NEVER actually do something like this.
        ‘add‘: function(store, rec){
            var r = rec[0];
            r.data[Ext.ensible.cal.EventMappings.EventId.name] = r.id;
            r.phantom = false;
            r.commit();
        }
    }
});

App = function() {
    return {
        init: function() {

            Ext.BLANK_IMAGE_URL = ‘http://extjs.cachefly.net/ext-3.1.0/resources/images/default/s.gif‘;

            // This is an example calendar store that enables event color-coding
            this.calendarStore = new Ext.ensible.sample.CalendarStore({
                // defined in data-calendars.js
                data: Ext.ensible.sample.CalendarData
            });

            // A sample event store that loads static JSON from a local file. Obviously a real
            // implementation would likely be loading remote data via an HttpProxy, but the
            // underlying store functionality is the same.
            this.eventStore = new Ext.ensible.sample.MemoryEventStore({
                // defined in data-events.js
                data: Ext.ensible.sample.EventData
            });

            // This is the app UI layout code.  All of the calendar views are subcomponents of
            // CalendarPanel, but the app title bar and sidebar/navigation calendar are separate
            // pieces that are composed in app-specific layout code since they could be omitted
            // or placed elsewhere within the application.
            new Ext.Viewport({
                layout: ‘border‘,
                renderTo: ‘calendar-ct‘,
                items: [{
                    id: ‘app-header‘,
                    region: ‘north‘,
                    height: 35,
                    border: false,
                    contentEl: ‘app-header-content‘
                }, {
                    id: ‘app-center‘,
                    title: ‘...‘, // will be updated to the current view‘s date range
                    region: ‘center‘,
                    layout: ‘border‘,
                    listeners: {
                        ‘afterrender‘: function() {
                            Ext.getCmp(‘app-center‘).header.addClass(‘app-center-header‘);
                        }
                    },
                    items: [{
                        id: ‘app-west‘,
                        region: ‘west‘,
                        width: 176,
                        border: false,
                        items: [{
                            xtype: ‘datepicker‘,
                            id: ‘app-nav-picker‘,
                            cls: ‘ext-cal-nav-picker‘,
                            listeners: {
                                ‘select‘: {
                                    fn: function(dp, dt) {
                                        App.calendarPanel.setStartDate(dt);
                                    },
                                    scope: this
                                }
                            }
                        }, {
                            xtype: ‘extensible.calendarlist‘,
                            store: this.calendarStore,
                            border: false,
                            width: 175
                        }, {
                            xtype: ‘button‘,
                            text: ‘Manage Calendars‘,
                            handler: function() {
                                App.calendarWindow.show();
                            }
}]
                        }, {
                            xtype: ‘extensible.calendarpanel‘,
                            eventStore: this.eventStore,
                            calendarStore: this.calendarStore,
                            border: false,
                            id: ‘app-calendar‘,
                            region: ‘center‘,
                            activeItem: 3, // month view

                            // Any generic view options that should be applied to all sub views:
                            viewConfig: {
                            //enableFx: false
                        },

                        // View options specific to a certain view (if the same options exist in viewConfig
                        // they will be overridden by the view-specific config):
                        monthViewCfg: {
                            showHeader: true,
                            showWeekLinks: true,
                            showWeekNumbers: true
                        },

                        multiWeekViewCfg: {
                        //weekCount: 3
                    },

                    // Some optional CalendarPanel configs to experiment with:
                    //readOnly: true,
                    //showDayView: false,
                    //showMultiDayView: true,
                    //showWeekView: false,
                    //showMultiWeekView: false,
                    //showMonthView: false,
                    //showNavBar: false,
                    //showTodayText: false,
                    //showTime: false,
                    //editModal: true,
                    //title: ‘My Calendar‘, // the header of the calendar, could be a subtitle for the app

                    // Once this component inits it will set a reference to itself as an application
                    // member property for easy reference in other functions within App.
                    initComponent: function() {
                        App.calendarPanel = this;
                        this.constructor.prototype.initComponent.apply(this, arguments);
                    },

                    //                        plugins: [{
                    //                            ptype: ‘ext.ensible.cal.contextmenu‘
                    //                        }],

                    listeners: {
                        ‘eventclick‘: {
                            fn: function(vw, rec, el) {
                                this.clearMsg();
                            },
                            scope: this
                        },
                        ‘eventover‘: function(vw, rec, el) {
                            //console.log(‘Entered evt rec=‘+rec.data[Ext.ensible.cal.EventMappings.Title.name]‘, view=‘+ vw.id +‘, el=‘+el.id);
                        },
                        ‘eventout‘: function(vw, rec, el) {
                            //console.log(‘Leaving evt rec=‘+rec.data[Ext.ensible.cal.EventMappings.Title.name]+‘, view=‘+ vw.id +‘, el=‘+el.id);
                        },
                        ‘eventadd‘: {
                            fn: function(cp, rec) {
                                this.showMsg(‘Event ‘ + rec.data[Ext.ensible.cal.EventMappings.Title.name] + ‘ was added‘);
                            },
                            scope: this
                        },
                        ‘eventupdate‘: {
                            fn: function(cp, rec) {
                                this.showMsg(‘Event ‘ + rec.data[Ext.ensible.cal.EventMappings.Title.name] + ‘ was updated‘);
                            },
                            scope: this
                        },
                        ‘eventdelete‘: {
                            fn: function(cp, rec) {
                                //this.eventStore.remove(rec);
                                this.showMsg(‘Event ‘ + rec.data[Ext.ensible.cal.EventMappings.Title.name] + ‘ was deleted‘);
                            },
                            scope: this
                        },
                        ‘eventcancel‘: {
                            fn: function(cp, rec) {
                                // edit canceled
                            },
                            scope: this
                        },
                        ‘viewchange‘: {
                            fn: function(p, vw, dateInfo) {
                                if (this.editWin) {
                                    this.editWin.hide();
                                };
                                if (dateInfo !== null) {
                                    // will be null when switching to the event edit form so ignore
                                    Ext.getCmp(‘app-nav-picker‘).setValue(dateInfo.activeDate);
                                    this.updateTitle(dateInfo.viewStart, dateInfo.viewEnd);
                                }
                            },
                            scope: this
                        },
                        ‘dayclick‘: {
                            fn: function(vw, dt, ad, el) {
                                this.clearMsg();
                            },
                            scope: this
                        },
                        ‘rangeselect‘: {
                            fn: function(vw, dates, onComplete) {
                                this.clearMsg();
                            },
                            scope: this
                        },
                        ‘eventmove‘: {
                            fn: function(vw, rec) {
                                rec.commit();
                                var time = rec.data[Ext.ensible.cal.EventMappings.IsAllDay.name] ? ‘‘ : ‘ \\a\\t g:i a‘;
                                this.showMsg(‘Event ‘ + rec.data[Ext.ensible.cal.EventMappings.Title.name] + ‘ was moved to ‘ +
                                        rec.data[Ext.ensible.cal.EventMappings.StartDate.name].format(‘F jS‘ + time));
                            },
                            scope: this
                        },
                        ‘eventresize‘: {
                            fn: function(vw, rec) {
                                rec.commit();
                                this.showMsg(‘Event ‘ + rec.data[Ext.ensible.cal.EventMappings.Title.name] + ‘ was updated‘);
                            },
                            scope: this
                        },
                        ‘eventdelete‘: {
                            fn: function(win, rec) {
                                this.eventStore.remove(rec);
                                this.showMsg(‘Event ‘ + rec.data[Ext.ensible.cal.EventMappings.Title.name] + ‘ was deleted‘);
                            },
                            scope: this
                        },
                        ‘initdrag‘: {
                            fn: function(vw) {
                                if (this.editWin && this.editWin.isVisible()) {
                                    this.editWin.hide();
                                }
                            },
                            scope: this
                        }
                    }
}]
}]
                });
            },

            // The CalendarPanel itself supports the standard Panel title config, but that title
            // only spans the calendar views.  For a title that spans the entire width of the app
            // we added a title to the layout‘s outer center region that is app-specific. This code
            // updates that outer title based on the currently-selected view range anytime the view changes.
            updateTitle: function(startDt, endDt) {
                var p = Ext.getCmp(‘app-center‘);

                if (startDt.clearTime().getTime() == endDt.clearTime().getTime()) {
                    p.setTitle(startDt.format(‘F j, Y‘));
                }
                else if (startDt.getFullYear() == endDt.getFullYear()) {
                    if (startDt.getMonth() == endDt.getMonth()) {
                        p.setTitle(startDt.format(‘F j‘) + ‘ - ‘ + endDt.format(‘j, Y‘));
                    }
                    else {
                        p.setTitle(startDt.format(‘F j‘) + ‘ - ‘ + endDt.format(‘F j, Y‘));
                    }
                }
                else {
                    p.setTitle(startDt.format(‘F j, Y‘) + ‘ - ‘ + endDt.format(‘F j, Y‘));
                }
            },

            // This is an application-specific way to communicate CalendarPanel event messages back to the user.
            // This could be replaced with a function to do "toast" style messages, growl messages, etc. This will
            // vary based on application requirements, which is why it‘s not baked into the CalendarPanel.
            showMsg: function(msg) {
                Ext.fly(‘app-msg‘).update(msg).removeClass(‘x-hidden‘);
            },

            clearMsg: function() {
                Ext.fly(‘app-msg‘).update(‘‘).addClass(‘x-hidden‘);
            }
        }
    } ();

Ext.onReady(App.init, App);

///////////////////////////////////////////////////////////////////////////////////////////////////////////
//Dynamic Calendars support.
Ext.onReady(function() {
    App.calendarWindowMenu = new Ext.menu.Menu({
        cls: ‘x-calendar-list-menu‘,
        items: [new Ext.ensible.cal.ColorPalette({
            handler: function(palette, colorId) {
                var record = App.calendarPanel.calendarStore.getAt(App.calendarWindowMenu.recordIndex);
                record.set(‘ColorId‘, colorId);
                App.calendarWindowMenu.hide();
                App.calendarWindowDataView.refreshNode(App.calendarWindowMenu.recordIndex);
            }
        }),
    new Ext.menu.Item({
        text: ‘Delete‘,
        iconCls: ‘no-icon‘,
        handler: function() {
            Ext.Msg.confirm(‘Action confirmation‘, ‘Please ensure no Event is associated to this Calendar. Continue with deletion?‘,
                    function(btn) {
                        if (btn == ‘yes‘) {
                            App.calendarPanel.calendarStore.removeAt(App.calendarWindowMenu.recordIndex);
                        }
                    });
        }
    })]
    });

    App.calendarWindow = new Ext.Window({
        title: ‘Manage Calendars‘,
        width: 325,
        height: 400,
        modal: true,
        layout: ‘fit‘,
        closeAction: ‘hide‘,
        bodyStyle: ‘background-color: white‘,
        items: [new Ext.DataView({
            store: App.calendarPanel.calendarStore,
            cls: ‘x-combo-list‘,
            style: ‘background-color: white; padding: 5px‘,
            itemSelector: ‘.x-combo-list-item‘,
            selectedClass: ‘x-combo-selected‘,
            overClass: ‘x-combo-selected‘,
            autoScroll: true,
            tpl: new Ext.XTemplate(
            ‘<div>Click on a Calendar to change its color or remove it.</div>‘,
            ‘<tpl for=".">‘,
                ‘<div class="x-combo-list-item" style="vertical-align: middle">‘,
                    ‘<div class="x-cal-{ColorId}">‘,
                        ‘<div class="mail-calendar-cat-color ext-cal-picker-icon" onmouseover="Ext.get(this).addClass(\‘mail-calendar-cat-color-over\‘);" onmouseout="Ext.get(this).removeClass(\‘mail-calendar-cat-color-over\‘);"> </div>‘,
                    ‘</div>‘,
                    ‘<div>{Title}</div>‘,
                ‘</div>‘,
            ‘</tpl>‘,
            ‘<div class="x-clear"></div>‘
        ),
            multiSelect: false,
            listeners: {
                click: function(view, index, node, e) {
                    App.calendarWindowMenu.recordIndex = index;

                    App.calendarWindowMenu.show(Ext.get(node));
                }
            }
        })],
        buttons: [{ text: ‘Add Calendar‘,
            handler: function() {
                Ext.Msg.prompt(‘Enter name‘, ‘Enter calendar name:‘,
            function(btn, text) {
                if (btn != ‘ok‘)
                    return;

                if (App.calendarPanel.calendarStore.findExact(‘Title‘, text) != -1) {
                    Ext.Msg.alert(‘Invalid input‘, ‘A Calendar with the same name already exists.‘);
                } else {
                    App.calendarPanel.calendarStore.loadData({ calendars: [{ title: text, color: 1}] }, true);
                }
            });
            }
        }, { text: ‘Save Changes‘,
            handler: function() {
                Ext.Msg.alert(‘Save‘, ‘Save changes to the Calendars on the server here.‘);
                App.calendarPanel.calendarStore.commitChanges();
                App.calendarWindow.hide();
            }
        }, { text: ‘Cancel‘,
            handler: function() {
                App.calendarPanel.calendarStore.rejectAllChanges();
                App.calendarWindowDataView.refresh();
                App.calendarWindow.hide();
            }
        }
    ]
    });

    App.calendarWindowDataView = App.calendarWindow.items.items[0];
});

Ext.data.Store.prototype.rejectAllChanges = function() {
    this.rejectChanges();
    for (var i = this.data.length - 1; i >= 0; i--) {
        var rec = this.data.items[i];
        if (rec.phantom) {
            this.remove(rec);
            if (Ext.isArray(this.deleted)) {
                this.deleted.remove(rec);
            }
            if (Ext.isArray(this.removed)) {
                this.removed.remove(rec);
            }
        }
    }
}

  dynamic-calendars.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <title>Extensible Calendar - Dynamic Calendars</title>
    <!-- Ext includes http://extjs.cachefly.net/-->
    <link rel="stylesheet" type="text/css" href="extjs3.2/resources/css/ext-all.css" />
    <script type="text/javascript" src="extjs3.2/adapter/ext/ext-base-debug.js"></script>
    <script type="text/javascript" src="extjs3.2/ext-all-debug.js"></script>

    <!-- Extensible includes -->
    <link rel="stylesheet" type="text/css" href="calendar/css/extensible-all.css" />
    <script type="text/javascript" src="calendar/extensible-all.js"></script>

    <!-- Page-specific includes -->
    <link rel="stylesheet" type="text/css" href="test-app.css" />
	<script type="text/javascript" src="dynamic-calendars.js"></script>

	<style type="text/css">
		.mail-calendar-cat-color {
			float: left;
			width: 10px;
			height: 10px;
			margin-right: 10px;
		}

		.mail-calendar-cat-color-over {
			width: 12px;
			height: 12px;
		}
	</style>
</head>
<body>
    <div style="display:none;">
    <div id="app-header-content">
        <div id="app-logo">
            <div class="logo-top"> </div>
            <div id="logo-body"> </div>
            <div class="logo-bottom"> </div>
        </div>
        <h1>Ext Calendar Pro <span>BETA</span></h1>
        <span id="app-msg" class="x-hidden"></span>
    </div>
    </div>
</body>
<script type="text/javascript">
    var updateLogoDt = function () {
        document.getElementById(‘logo-body‘).innerHTML = new Date().getDate();
    }
    updateLogoDt();
    setInterval(updateLogoDt, 1000);
</script>
</html>

  

时间: 2024-08-08 09:37:24

Js: Extensible Calendar Examples的相关文章

Java Date and Calendar examples

This tutorial shows you how to work with java.util.Date and java.util.Calendar. 1. Java Date ExamplesFew examples to work with Date APIs. Example 1.1 – Convert Date to String. SimpleDateFormat sdf = new SimpleDateFormat("dd/M/yyyy"); String date

vue2.0项目 calendar.js(日历组件封装)

最近一直闲来无事,便寻思着做一下自己的个人项目,也想说能使用现在比较流行的一些mvvm框架来做,于是就选用了这样的一个技术栈vue2.0+vue-router+vuex+webpack来做,做得也是多页面应用,使用vue-router,也是想说把多个功能模块化,单个模块spa,实现更高的效果.当然现在还在做的过程中,如果感兴趣可以过来star一下,哈哈,https://github.com/xiaobinwu/Wuji,git clone下来看看. 今天要说的是在做这个项目的过程中,自己想加一个

vue.js组件化开发实践

前言 公司以往制作一个H5活动,特别是有一定统一结构的活动都要每次用html.css.js滚一次重复的轮子,费时费力.后来接到了一个基于模板的活动发布系统的需求,于是就有了下面的内容. 开始 需求一到,接就是怎么实现,技术选型自然成为了第一个问题.鉴于目前web前端mvvm框架的流行,以及组件化开发方式的出现,决定采用vue进行开发. 这里首先简单说下web前端组件化开发方式的历程: 最早的组件化结构,或者叫做组件化1.0时代,代码结构可能如下: 1 - lib/components/calen

Threejs 官网 - 检测使用 three.js 时的 WebGL 和浏览器兼容性(Detecting WebGL and browser compatibility with three.js)

检测使用 three.js 时的 WebGL 和浏览器兼容性(Detecting WebGL and browser compatibility with three.js) 太阳火神的美丽人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途-保持一致"创作公用协议 转载请保留此句:太阳火神的美丽人生 -  本博客专注于 敏捷开发及移动和物联设备研究:iOS.Android.Html5.Arduino.pcDuino,否则,出自本博客的文章

【翻译】探究Ext JS 5和Sencha Touch的布局系统

原文:Exploring the Layout System in Ext JS 5 and Sencha Touch 布局系统是Sencha框架中最强大和最有特色的一个部分. 布局要处理应用程序中每一个组件的尺寸和位置.在Ext JS和Sencha Touch直接有很多相似之处.尤其是如今Ext JS 5開始支持平板更是如此.以下让我们来探讨一下布局系统是怎样跨域Sencha框架进行工作的. 布局简史 最主要的HTML一直都缺乏一个严格定义的布局系统. 很多年来,因为CSS实现的差距.开发跨浏

Road to the future——伪MVVM库Q.js

模仿Vuejs的伪MVVM库,下面是使用说明 项目地址:https://github.com/miniflycn/Q.js 相关项目:https://github.com/miniflycn/Ques 一个简单例子 模版: <a href="javascript:void(0)" q-text="msg"></a> 脚本: var vm = new Q({ el: '#demo', data: { msg: 'hello' } }); 则会展

WEBGL用户文档(四):three.js的结构

我们知道three.js有几大件,掌握好这几个类,那么就算入门了! 场景scene,摄像机camera,渲染器render.光源light.控制control.加载器loader three.js的写法由一个套路,基本上是 1.新建场景* 2.摄像机* 3.新建object3d,光源等(添加到场景)※ 4.新建渲染器并渲染*(three.js-master\examples\js\renderers) 5.添加控制※(three.js-master\examples\js\controls) 6

Web3D编程入门总结——WebGL与Three.js基础介绍

1 /*在这里对这段时间学习的3D编程知识做个总结,以备再次出发.计划分成“webgl与three.js基础介绍”.“面向对象的基础3D场景框架编写”.“模型导入与简单3D游戏编写”三个部分,其他零散知识以后有机会再总结.*/ 2 /*第一部分,webgl与three.js基础介绍,要求读者掌握JavaScript入门知识*/ 3 //webgl原理:通过JavaScript语言在浏览器端生成glsl代码,把glsl代码送入显卡执行,把执行结果显示在浏览器中 4 //简单例程: 5 //根据To

easyloader.js源代码分析

http://www.cnblogs.com/jasonoiu/p/easyloader_source_code_analysis.html Jquery easyui是一个javascript UI 组件库,使用它可以快速开发企业级的业务系统.如果你正准备开发系统后台,可以选择jquery easyui,也可以选择Ext JS.我个人的看法是,如果开发团队就两三个人,开发工期很短,就一两个月.那么选择jquery easyui就对了,jquery easyui源代码量不多,便于阅读和自行修改.