Ext.define("App.view.MessageDetailWindow", {
    extend: "Ext.window.Window",
    alias: "widget.messageDetailWindow",
    xtype: "messageDetailWindow",
    title: App.localeRes("Chat Record(s)"),
    constrainHeader: true,
    modal: true,
    width: 800,
    height: 600,
    resizable: true,

    initComponent: function() {
        var me = this;
        Ext.apply(me, {
            items: [
                {
                    xtype: "messageDetail",
                    name: "messageDetail",
                    height: 560,
                    width: 800
                }
            ],
            listeners: {
                show: function() {
                    var md = me.down("messageDetail");
                    md.setHidden(false);
                    if (me.params.mtId) {
                        md.setData({
                            mtId: me.params.mtId
                        });
                    } else {
                        md.setData({
                            refType: me.params.refType,
                            refId: me.params.refId,
                            refCode: me.params.refCode
                        });
                    }
                    md.expand();
                }
            }
        });
        me.callParent(arguments);
    }
});
