解决方案 »

  1.   

    validator: function (value) {
                                var validator = this;
                                var form=this.up('form');
                                var tid=form.getForm().findField('tid');
                                var error = true;
                                Ext.Ajax.request({
                                    async: false,
                                    scope: validator,
                                    url: URL_ENP_CHECK,
                                    params: { enterprisecode: this.value,enpid:tid.value},
                                    method: 'POST',
                                    success: function (response) {
                                    
                                        var result = Ext.JSON.decode(response.responseText);
                                        if (!result.success) {
                                            error = "该企业编码己经存在,请重新输入!";
                                        }
                                    }
                                });
                                return error;
                            },