// <#-- Calendar Store -->
Ext.define("App.store.CalendarStore", {
    extend: "Ext.data.Store",
    autoLoad: false,
    constructor: function(cfg) {
        var me = this;
        cfg = cfg || {}; 
        me.callParent([
            Ext.apply(
                {
                    proxy: {
                        type: "ajax",
                        url: App.url("/meeting/calendar.json"),
                        extraParams: cfg.extraParams || {},
                        reader: {
                            type: "json",
                            rootProperty: "records",
                            idProperty: "id"
                        }
                    },
                    fields: me.genFields()
                },
                cfg
            )
        ]);
    },
    genFields: function() {
        var fields = [];
        fields.push({
            name: "id",
            type: "int",
            allowNull: true
        });
        for (let i = 1; i < 7; i++) {
            fields.push(
                {
                    name: "col_" + i,
                    type: "date",
                    dateFormat: "time"
                },
                {
                    name: "col_" + i + "_clickable",
                    type: "boolean"
                },
                {
                    name: "col_" + i + "_day",
                    type: "string"
                },
            );
        }
        return fields;
    }
});
