Ext.define("App.store.MsgStore", {
    extend: "Ext.data.Store",

    constructor: function(cfg) {
        var me = this;
        cfg = cfg || {};

        me.callParent([
            Ext.apply(
                {
                    proxy: {
                        type: "ajax",
                        url: App.url("/message/webmsg-list.json"),
                        extraParams: cfg.extraParams || {},
                        reader: {
                            type: "json",
                            rootProperty: "records",
                            idProperty: "id"
                        }
                    },
                    groupField: "department",
                    fields: [
                        { name: "mtId", type: "int", allowNull: true },
                        { name: "topic", type: "string" },
                        { name: "refId", type: "int" },
                        { name: "refCode", type: "string" },
                        { name: "refType", type: "string" },
                        { name: "updatedBy", type: "string" },
                        { name: "updatedById", type: "int" },
                        { name: "readed", type: "boolean" },
                        { name: "modified", type: "date", dateFormat: "time" }
                    ]
                },
                cfg
            )
        ]);
    }
});
