首页 > 代码库 > 如何使用Ext.create() 调用一个窗体

如何使用Ext.create() 调用一个窗体

Ext.define("Scripts.Code.QM.OutgoingQuality.OQC.ReinspRequest.view.DefectContentsDetailInfoWindow", {    extend: "Ext.window.Window",    alias: "widget.Ali_DefectContentsDetailInfoWindow",    initComponent: function () {        Ext.apply(this, {            title: "Rework Req  Reg - Defect Content",            width: 850,            height: 450,            modal: true,            border: 0,            buttonAlign: "center",            closeAction: ‘close‘,            layout: "fit",            items: [                Ext.create("Scripts.Code.QM.OutgoingQuality.OQC.ReinspRequest.view.DefectContentsDetailInfo")            ],            buttons: [                {                    text: "Close",                    action: "close",                    scope: this,                    listeners: {                        click: function (button) {                            var win = button.up(‘window‘);                            win.close();                        }                    }                }            ]        });        this.callParent(arguments);    }});

Ext.define("Scripts.Code.QM.OutgoingQuality.OQC.ReinspRequest.view.DefectContentsDetailInfo", {
extend: "Ext.grid.Panel",
alias: ‘widget.Ali_DefectContentsDetailInfo‘,
store: Ext.create("Scripts.Code.QM.OutgoingQuality.OQC.ReinspRequest.store.DefectQtyStore"),//‘DefectQtyStore‘,
border: 0,
viewConfig: {
autoScroll: true,
columnLines: true,
enableTextSelection: true
},
initComponent: function () {
this.columns = [
{ xtype: ‘rownumberer‘, text: ‘NO.‘, width: 30 },
{ header: "Insp. Class", dataIndex: "INSP_CLSF_CODE", width: 166 },
{ header: "Serial No.", dataIndex: "PROD_SN", width: 101 },
{ header: "Insp Art", dataIndex: "INSP_ART_CODE", width: 200 },
{ header: "Insp Dtl Art", dataIndex: "INSP_ART_DTL_CODE", width: 300 },
{ header: "Char. Insp.", dataIndex: "CHAR_INSP_VALUE" },
{ header: "Insp Numal", dataIndex: "NUMAL_INSP_VALUE" },
{ header: "Defect Decision", dataIndex: "DEFT_DECI_CODE" },
{ header: "Defect Type", dataIndex: "DEFT_TYPE_CODE" },
{ header: "Defect Code", dataIndex: "DEFT_CODE", width: 200 },
{ header: "Deft Cause Code", dataIndex: "DEFT_CAUSE_TYPE_CODE" },
{ header: "Deft Cause", dataIndex: "DEFT_CAUSE_CODE" }
];
this.callParent(arguments);
}
}
);

 

不需要引用,用法:

var win = Ext.create("Scripts.Code.QM.OutgoingQuality.OQC.ReinspRequest.view.DefectContentsDetailInfoWindow"); //Ext.widget("Ali_DefectContentsDetailInfoWindow");
win.show();

如何使用Ext.create() 调用一个窗体