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

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

        me.callParent([
            Ext.apply(
                {
                    proxy: {
                        type: "ajax",
                        url: App.url("/user/combo.json"),
                        extraParams: cfg.extraParams || {},
                        reader: {
                            type: "json",
                            rootProperty: "records",
                            idProperty: "id"
                        }
                    },
                    groupField: "department",
                    fields: [
                        { name: "id", type: "int", allowNull: true },
                        { name: "username", type: "string" },
                        { name: "department", type: "string" }
                    ]
                },
                cfg
            )
        ]);
    }
});
