4

私は使用してextensible-1.5.1おり、アプリを実行しています

extensible-1.5.1/examples/calendar/TestApp/test-app.html

Eventこのフォームに新しいを追加して、フォームウィンドウをカスタマイズしようとしていtextfieldます。ここにフォームのデフォルトがあります

ここに画像の説明を入力

しかし、編集するファイルが見つかりません。

であると思いますextensible-1.5.1\src\calendar\form\EventWindow.js。しかし、srcフォルダーを削除しても、プロジェクトはまだ機能していて、何も変わらないのですか?

ありがとうございます

編集ファイル
で見つけました。extensible-all-debug.jsしかし、そのファイルは本当に複雑です

extjs の例のextensible-1.5.1\src\ようにデータを使用するように構成する方法calendar

4

1 に答える 1

5

使用する必要があるクラスは ですExtensible.calendar.form.EventWindow。ただし、そのファイルを編集する代わりに、そのクラスを拡張して独自のバージョンを作成する必要があります。そのファイルをガイドとして使用し、getFormItemConfigs関数をオーバーライドして、必要に応じてフォームを変更できます。

Ext.define("MyApp.view.EventWindow", {
    extend: "Extensible.calendar.form.EventWindow",
    modal: true,
    enableEditDetails: false,

    initComponent: function()
    {
        this.callParent();
    },

    getFormItemConfigs: function() {
        var items = [/*your form items here */];

        return items;
    },
    //... other stuff here maybe...
});

次に、 をオーバーライドして、Extensible.calendar.view.AbstractCalendar作成したばかりのクラスを使用できます。

Ext.define("MyApp.view.AbstractCalendarOverride", {
    override: 'Extensible.calendar.view.AbstractCalendar',

    getEventEditor : function()
    {
        this.editWin = this.ownerCalendarPanel.editWin;

        if(!this.editWin)
        {
            //Change this line:
            this.ownerCalendarPanel.editWin = Ext.create('MyApp.view.EventWindow', {
                id: 'ext-cal-editwin',
                calendarStore: this.calendarStore,
                modal: this.editModal,
                enableEditDetails: this.enableEditDetails,
                listeners: {
                    'eventadd': {
                        fn: function(win, rec, animTarget) {
                            //win.hide(animTarget);
                            win.currentView.onEventAdd(null, rec);
                        },
                        scope: this
                    },
                    'eventupdate': {
                        fn: function(win, rec, animTarget) {
                            //win.hide(animTarget);
                            win.currentView.onEventUpdate(null, rec);
                        },
                        scope: this
                    },
                    'eventdelete': {
                        fn: function(win, rec, animTarget) {
                            //win.hide(animTarget);
                            win.currentView.onEventDelete(null, rec);
                        },
                        scope: this
                    },
                    'editdetails': {
                        fn: function(win, rec, animTarget, view) {
                            // explicitly do not animate the hide when switching to detail
                            // view as it looks weird visually
                            win.animateTarget = null;
                            win.hide();
                            win.currentView.fireEvent('editdetails', win.currentView, rec);
                        },
                        scope: this
                    },
                    'eventcancel': {
                        fn: function(win, rec, animTarget){
                            this.dismissEventEditor(null, animTarget);
                            win.currentView.onEventCancel();
                        },
                        scope: this
                    }
                }
            });
        }

        // allows the window to reference the current scope in its callbacks
        this.editWin.currentView = this;
        return this.editWin;
    }
});

これで必要なものが正確に得られるとは限りませんが、うまくいけば、正しい軌道に乗ることができます。

于 2013-10-22T12:01:18.310 に答える