Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var employeeDetails=Ext.create('Ext.form.Panel', {
- id : 'form1',
- title : 'Employee Personal Details',
- url : 'EmployeeDetails.jsp',
- height: 600,
- //width: 500,
- x:400,
- width : 600,
- //autoHeight : true,
- frame : true,
- bodyPadding : '10 20',
- defaults : {
- x:60,
- anchor : '72%',
- msgTarget : 'under',
- allowBlank :true
- },
- items : [{
- xtype : 'combobox',
- id : 'empCode',
- fieldLabel : 'Employee Code',
- store : myStore,
- displayField : 'codeemp',
- valueField : 'codeemp',
- typeAhead : false,
- queryMode : 'local',
- forceSelection : true,
- editable : true,
- triggerAction : 'all',
- emptyText : 'Select one..'
- }, {
- xtype : 'textfield',
- allowBlank:true,
- name: 'fname',
- id : 'fname',
- maxLength : 20,
- minLength : 3,
- maxLengthText : 'should not exceed 20 characters.',
- fieldLabel : 'First Name',
- emptyText : 'Type your first name here',
- minLengthText : 'minimum 3 characters',
- maskRe : /[a-z]/i
- }, {
- xtype : 'textfield',
- name: 'mname',
- fieldLabel : 'Middle Name',
- id:'mname',
- maxLength : 20,
- minLength : 3,
- maxLengthText : 'should not exceed 20 characters.',
- emptyText : 'Type your middle name here',
- maskRe : /[a-z]/,
- msgTarget : 'under',
- minLengthText : 'minimum 3 characters'
- }, {
- xtype : 'textfield',
- fieldLabel : 'Last Name',
- id : 'lname',
- name:'lname',
- maxLength : 20,
- maxLengthText : 'should not exceed 20 characters.',
- minLength : 3,
- emptyText : 'Type your last name here',
- maskRe : /[a-z]/,
- msgTarget : 'under',
- minLengthText : 'minimum 3 characters'
- },{
- xtype : 'textfield',
- fieldLabel : 'User Name',
- id : 'uname',
- name:'uname',
- maxLength : 20,
- maxLengthText : 'should not exceed 20 characters.',
- minLength : 3,
- emptyText : 'Type your last name here',
- maskRe : /[a-z]/,
- msgTarget : 'under',
- minLengthText : 'minimum 3 characters'
- },{
- fieldLabel : 'Gender',
- xtype : 'radiogroup',
- id:'radios',
- columns : [50, 100],
- items : [{
- xtype : 'radiofield',
- boxLabel : 'Male',
- checked : true,
- id:'radios1',
- name:'gender',
- inputValue:'male'
- }, {
- xtype : 'radiofield',
- boxLabel : 'Female',
- id:'radios2',
- name:'gender',
- inputValue:'Female'
- }]
- },{
- xtype : 'datefield',
- id:'jdate',
- name : 'jdate',
- fieldLabel : 'Joining Date',
- format : 'd-m-Y',
- anchor : '72%'
- },{
- xtype : 'datefield',
- id:'dob',
- name : 'dob',
- fieldLabel : 'Date Of Birth',
- format : 'd-m-Y',
- anchor : '72%'
- },{
- xtype : 'combobox',
- id : 'designation',
- fieldLabel : 'designation',
- store : desgnation,
- displayField : 'dsgn',
- valueField : 'dsgn',
- typeAhead : false,
- queryMode : 'local',
- forceSelection : true,
- editable : true,
- triggerAction : 'all',
- emptyText : 'Select one..'
- },{
- xtype : 'combobox',
- id : 'role',
- fieldLabel : 'Role',
- store : role,
- displayField : 'rl',
- valueField : 'rl',
- typeAhead : false,
- queryMode : 'local',
- forceSelection : true,
- editable : true,
- triggerAction : 'all',
- emptyText : 'Select one..'
- },{
- xtype : 'textfield',
- id : 'emailId',
- fieldLabel : 'Email Id',
- vtype:'email',
- emptyText : 'Email like [email protected]'
- },{
- xtype : 'combobox',
- id : 'repPerson',
- fieldLabel : 'Reporting Person',
- store : rPerson,
- displayField : 'rp',
- valueField : 'rp',
- typeAhead : false,
- queryMode : 'local',
- forceSelection : true,
- editable : true,
- triggerAction : 'all',
- emptyText : 'Select one..'
- },{
- fieldLabel : 'Status',
- xtype : 'radiogroup',
- id:'radiosstatus',
- columns : [50, 100],
- items : [{
- xtype : 'radiofield',
- boxLabel : 'Active',
- checked : true,
- //id:'radios1',
- name:'st',
- inputValue:'Active'
- }, {
- xtype : 'radiofield',
- boxLabel : 'InActive',
- //id:'radios2',
- name:'st',
- inputValue:'InActive'
- }]
- }/*{
- xtype : 'combobox',
- id : 'employeeStatus',
- fieldLabel : 'Employee Status',
- store : empStatus,
- displayField : 'status',
- valueField : 'status',
- typeAhead : false,
- queryMode : 'local',
- forceSelection : true,
- editable : true,
- triggerAction : 'all',
- emptyText : 'Select one..'
- }*/,{
- xtype : 'textfield',
- id : 'empPancard',
- fieldLabel : 'Pan Card No',
- emptyText : 'Type your Pan Card Number here'
- },{
- xtype : 'combobox',
- id : 'bloodGroup',
- fieldLabel : 'Blood Group',
- store : empBloodGroup,
- displayField : 'bloodGroup',
- valueField : 'bloodGroup',
- typeAhead : false,
- queryMode : 'local',
- forceSelection : true,
- editable : true,
- triggerAction : 'all',
- emptyText : 'Select one..'
- },{
- xtype : 'textfield',
- id : 'mobPhone',
- fieldLabel : 'Mobile Phone',
- emptyText : 'Type your Mobile Number here',
- maxLength : 10,
- maxLengthText : 'should not exceed 10 digits',
- maskRe : /[0-9]/
- },{
- xtype : 'textfield',
- id : 'homePhone',
- fieldLabel : 'Home Phone',
- emptyText : 'Type your Home Phone Number here',
- maxLength : 13,
- maxLengthText : 'should not exceed 13 digits',
- maskRe : /[0-9]/
- },{
- xtype: 'fileuploadfield',
- id: 'form-file',
- emptyText: 'Select an image',
- fieldLabel: 'Photo',
- name: 'photo-path',
- buttonText: 'Upload Photo',handler: function() {
- mydata.getForm().submit({
- waitMsg:'Saving...',
- reset:false,
- params: {
- moreinfo: 'moreparams'
- },
- success: function(form, action){
- oldPreview = fileUploadPhotoPreview.autoEl.src;
- newPhoto = "butterfly.jpg";
- fileUploadPhotoPreview.el.dom.src=newPreview;
- mydata.findById('photo').reset();
- alert ("ok");
- }
- ,
- failure: function( form, action){
- alert ("error");
- }
- });
- },
- buttonCfg: {
- iconCls: 'upload-icon'
- }
- },{
- xtype : 'combobox',
- id : 'martialStatus',
- fieldLabel : 'Martial Status',
- store : marStatus,
- displayField : 'mstatus',
- valueField : 'mstatus',
- typeAhead : false,
- queryMode : 'local',
- forceSelection : true,
- editable : true,
- triggerAction : 'all',
- emptyText : 'Select one..'
- }],
- buttonAlign: 'center',
- buttons: [{
- text : 'Save',
- formBind : true,
- id:'btnsave',
- handler : function() {
- /*onClick:
- //alert('hi'+Ext.getCmp('fname').getValue());
- // employeeDetails.getForm().submit({
- //method : 'POST',
- //waitTitle : 'Connecting',
- //waitMsg : 'Sending data...',
- //success : function(field) {
- Ext.Msg.alert('Confirm', 'Are you Sure want to save?',
- function(btn, text) {
- if (btn == 'ok') {
- var redirect = "final.html";
- window.location = redirect;
- employeeDetails.getForm().reset();
- }}
- );
- */
- }
- },{
- text: 'Clear',
- listeners:{
- click: function(p) {
- employeeDetails.getForm().reset();
- }}}]
- });
Advertisement
Add Comment
Please, Sign In to add comment