在extjs 3.4的窗口中加载表单的问题

时间:2019-01-28 12:14:05

标签: extjs extjs3

  

我在extjs 3.4的窗口中加载表单时遇到问题   extjs。下面的代码有一个按钮,然后单击按钮,我添加了处理程序   假设要将数据从uri“ partnercreditlimit”加载到窗口   以及从其他uri加载的标签栏。有人可以帮忙吗   我。

选项卡运行正常。但是未加载窗口内的表单。但我可以使用该表格成功插入数据。


我的代码如下:

{
    xtype: 'button',
    text: Ops.msg('adjust'),
    handler: function() {
        // per company.
        var parentform = this.getForm(),
            uri = "partnercreditlimit",   // individual permission.
            fmcfg = {};
        var pid = parentform.findField('uid').getValue(),
            paymentTermId = parentform.findField('paymentTerms.uid').getValue();
        if (paymentTermId > 0) {   // edit record
            fmcfg = {
                record: {
                    data: {
                        pid: pid
                    }
                }
            };
        }
        var win = new Ops.form.SubFormWindow({
            width: 650,
            height: 400,
            maximizable: false,
            title: Ops.msg('creditLimit'),
            items: Ext.apply({
                xtype: 'columnform',
                tbar:[{
                    id: this.form.id + '_dctr',
                    text: Ops.msg('uploadDocument'),
                    iconCls: 'put-icon',
                    handler: function() {
                        if (!this.docCtr) {
                            var me = this;
                            this.docCtr = new Ops.doc.DocCenterWin({
                                docId: me.uid,
                                docType:DocumentType.PARTNER,
                                uri: 'partner'
                            });
                        }
                        this.docCtr.show();
                    },
                    scope: this
                }],

                url: uri + ".htm",
                permission: prm(uri),
                appFormId: 'pid',
                formItems: [{
                    fieldLabel: Ops.msg('creditTerms'),
                    name: 'terms',
                    xtype: 'paymenttermscombo'
                }, {
                    name: 'ccycode',
                    xtype: 'ccycombo',
                    columnWidth: .2
                }, {
                    fieldLabel: Ops.msg('creditLimitAmount'),
                    xtype: 'numberfield',
                    name: 'amount',
                    columnWidth: .3
                }, {
                    fieldLabel: Ops.msg('formValidFrom'),
                    name: 'formFromdate',
                    xtype: 'datefield',
                    allowBlank: false
                }, {
                    fieldLabel: Ops.msg('formValidTo'),
                    name: 'formTodate',
                    xtype: 'datefield',
                    allowBlank: false
                }, {
                    fieldLabel: Ops.msg('bRValidFrom'),
                    name: 'brFromdate',
                    xtype: 'datefield',
                    allowBlank: false
                }, {
                    fieldLabel: Ops.msg('bRValidTo'),
                    name: 'brTodate',
                    xtype: 'datefield',
                    allowBlank: false
                }, {
                    xtype: 'hidden',
                    name: 'pid',
                    value: pid
                    }],
                commitChanges: function(form, obj){
                    parentform.setValues({
                        paymentTerms: form.getValues()
                    });
                    win.close();
                },
                deleteCallback: function(form, obj) {
                    parentform.setValues({
                        paymentTerms: {
                            terms: '',
                            ccycode: '',
                            amount: '',
                            formFromdate:'',
                            formTodate:'',
                            brFromdate:'',
                            brTodate:'',
                            uid: 0
                        }
                    });
                    win.close();
                }
            }, fmcfg)
        });
        win.show();
    },
    scope: this,
    flex: 1
}

0 个答案:

没有答案