Ext.namespace('Empresa'); var xg = Ext.grid; var column = { padding: 20, autoScroll : true, layout: { type: 'hbox', pack: 'start' //align: 'stretch' }, defaults: { frame: true }, items: [{ flex: 1, hidden: true }, { xtype: 'form', title: 'Cadastro de Empresas - VT', width: 700, height : 520, id : 'idFrmCadastroEmpresa', formId : 'frmCadastroEmpresa', frame : true, onSubmit : Ext.emptyFn, buttonAlign: 'right', padding: 20, //bodyStyle: 'padding:20px 0;', labelAlign: 'left', labelWidth: 120, items: [ { xtype : 'numberfield', labelSeparator: '', name : 'empresa.cpfCnpj', fieldLabel : 'C.P.F./C.N.P.J.', allowBlank : false, allowDecimals: false, allowNegative: false, maxLength : 18, tabIndex : 1, anchor:'50%', autoCreate: {tag: 'input', type: 'text', maxlength: '14'} }, { xtype : 'textfield', labelSeparator: '', name : 'empresa.nome', fieldLabel : 'Nome da Empresa', allowBlank : false, maxLength : 35, tabIndex : 2, anchor:'95%' }, { xtype : 'textfield', labelSeparator: '', name : 'empresa.inscricaoMunicipal', fieldLabel : 'Inscrição Municipal', allowBlank : true, maxLength : 15, tabIndex : 3, anchor:'40%' }, { xtype : 'numberfield', labelSeparator: '', name : 'empresa.codigoMunicipio', fieldLabel : 'Código do Município', allowBlank : true, allowDecimals: false, allowNegative: false, maxLength : 7, tabIndex : 4, anchor:'30%', autoCreate: {tag: 'input', type: 'text', maxlength: '7'} }, { xtype : 'textfield', labelSeparator: '', name : 'empresa.inscricaoEstadual', fieldLabel : 'Inscrição Estadual', allowBlank : true, maxLength : 30, tabIndex : 5, anchor:'57%' }, { xtype : 'textfield', labelSeparator: '', name : 'empresa.endereco', fieldLabel : 'Endereço', allowBlank : false, tabIndex : 6, maxLength : 35, anchor:'95%' }, { xtype: 'panel', layout:'column', items: [{ columnWidth: .5, layout: 'form', labelAlign: 'left', labelWidth: 120, items:[ { xtype : 'textfield', labelSeparator: '', name : 'empresa.bairro', fieldLabel : 'Bairro', allowBlank : false, tabIndex : 7, maxLength : 25, anchor:'90%' //width :200 }, { xtype : 'textfield', labelSeparator: '', id: '_idCEP', name : 'empresa.cep', fieldLabel : 'C.E.P', allowBlank : false, tabIndex : 8, maxLength : 9, anchor:'90%' //width :200 }, { xtype : 'textfield', labelSeparator: '', id: '_idFone', name : 'empresa.telefone', fieldLabel : 'Telefone', allowBlank : false, maxLength : 20, tabIndex : 9, anchor:'90%' //width :200 } ] },{ columnWidth: .5, layout: 'form', labelAlign: 'left', labelWidth: 63, items:[ { xtype : 'textfield', labelSeparator: '', name : 'empresa.cidade', fieldLabel : 'Cidade', allowBlank : false, maxLength : 20, tabIndex : 10, anchor:'90%' //width :200 }, { xtype : 'combo', name : 'empresa.estado', hiddenName : 'empresa.estado', fieldLabel : 'Estado', store : storeUF, displayField : 'nome', valueField : 'sigla', typeAhead : true, mode : 'local', forceSelection : true, triggerAction : 'all', selectOnFocus : true, allowBlank : false, editable: false, anchor:'90%', tabIndex : 11, value: 'SP' }, { xtype : 'textfield', labelSeparator: '', id: '_idFax', name : 'empresa.fax', fieldLabel : 'Fax', allowBlank : false, maxLength : 20, tabIndex : 12, anchor:'90%' //width :200 } ] } ] }, { xtype : 'textfield', labelSeparator: '', name : 'empresa.email', fieldLabel : 'Email', allowBlank : false, maxLength : 50, vtype: 'email', tabIndex : 13, anchor:'95%' }, { xtype : 'textfield', labelSeparator: '', name : 'empresa.contato', fieldLabel : 'Contato', allowBlank : false, maxLength : 35, tabIndex : 14, anchor:'95%' }, { xtype : 'textfield', labelSeparator: '', name : 'login', fieldLabel : 'Login do Sistema', allowBlank : false, maxLength : 20, minLength: 4, tabIndex : 15, anchor:'50%' }, { xtype : 'panel', tabIndex : 16, html: '
' + '   
' }, { xtype : 'panel', bodyStyle: 'text-align: center;', padding: 5, items: [ { xtype : 'textfield', labelSeparator: '', id: 'imgCaptcha', name : 'captchaResponse', fieldLabel : 'Texto de Segurança', allowBlank : false, width: 280, emptyText: 'Insira o texto de segurança da imagem acima', tabIndex : 17 } ] } ], buttons:[ { text: 'Enviar', iconCls : 'save-icon', tabIndex : 18, handler : function() { var form = Ext.getCmp('idFrmCadastroEmpresa').getForm(); form.submit({ method : 'POST' ,url : '/dig-sbe-vt/empresa/cadastro/empresaVT!incluir.dig' ,waitTitle : 'Aguarde...' ,waitMsg : 'Aguarde incluindo registro...' ,success : function(form, action) { if(action.result.success) { Ext.MessageBox.wait('Aguarde...', 'Informação'); window.location.href = '/dig-sbe-vt/empresa/cadastro/sucesso.jsp'; } else { msg(ret.msg); } } ,failure : function(form, action) { trataErroSubmitForm(form, action); form.isValid(); } }); } } ] }, { flex: 1, hidden: true } ] }; Empresa.principal = { id: 'start-panel', //title: 'Titulo', region: 'center', frame: false, layout: 'fit', items: column //items: centerLayout //,bodyStyle: 'padding:25px' }; Empresa.atualizaCaptcha = function() { var t = new Date(); Ext.getCmp('imgCaptcha').reset(); var imgCaptcha = Ext.get('_idCaptcha').dom; imgCaptcha.src = '/dig-sbe-vt/img_captcha.jpg?nc=' + t.getTime(); }