You are on page 1of 210

//#region "Public Variable" var _LastTabIndex; var _isEmployeeWindowsMoving; var _isInsertMode; var _isAddInternalWorkFromCurrentEmployment; var _isAddSMSForwardingToFromCurrentReportingTo; var _isAddCertificateFromCurrentExam;

var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var var _SelectedEmployeeRecord; __SelectedLastField; __SelectedPartialForm; __IsBackgroundProcess; __IsEditMode; __SelectedGridId; __SelectedDataStores; employeeDataStore; employeeWindow; employeeGrid; topEmployeeForm; gridContextMenu; ContextSentitiveRibbonMenu; selectedEmployeeScholarshipRecord; selectedEmployeeAddressRecord; selectedEmployeeContactRecord; selectedEmployeeNextOfKinRecord; selectedEmployeeReportingToSMSRecord; selectedEmployeeInternalWorkRecord; selectedEmployeeEducationRecord; selectedEmployeeTrainingRecord; selectedEmployeeCertificateRecord; selectedEmployeeExternalWorkRecord; selectedEmployeeOrganizationRecord; selectedEmployeeMilitaryConscriptRecord; selectedEmployeeAwardRecord; selectedEmployeeHobbyRecord; selectedEmployeeHealthRecord; selectedEmployeeReferenceRecord; selectedEmployeeQuestionTaskRecord; selectedEmployeeExamRecord; isPersonalDetailsTabShowed; isContactDetailsTabShowed; isAddressesTabShowed; isEmergencyAddressTabShowed; isIdentityCardsTabShowed; isFamilyStructuresTabShowed; isEmploymentStatusTabShowed; isResignationNoteTabShowed; isSMSForwardingToTabShowed; isInternalWorkingHistoryTabShowed; isSalaryandBenefitsTabShowed; isBankAccountandTaxInfoTabShowed; isEducationalBackgroundTabShowed; isTrainingsandSeminardsTabShowed; isProfesionalCertificatesTabShowed; isProfesionalExamTabShowed; isScholarshipsTabShowed; isExternalWorkingHistoryTabShowed; isSocialandPoliticalActivitiesTabShowed;

var var var var var var var var var

isMilitaryConscriptTabShowed; isNonScholarshipAwardsTabShowed; isLanguageAbilityTabShowed; isHobbyTabShowed; isMedicalRecordsTabShowed; isReferenceDetailsTabShowed; isQuestionnairesTabShowed; isMiscellaneousInfoTabShowed; employeeGridPagingCombo;

var isEmployeeContactDataStoreLoaded; var isEmployeeAddressDataStoreLoaded; var isEmployeeIdentificationDataStoreLoaded; var isEmployeeFamilyDataStoreLoaded; var isEmployeeReportingToSMSDataStoreLoaded; var isEmployeeInternalWorkDataStoreLoaded; var isEmployeeEmergencyAddressDataStoreLoaded; var isEmployeeEmergencyDataStoreLoaded; var isEmployeeEducationDataStoreLoaded; var isEmployeeTrainingDataStoreLoaded; var isEmployeeCertificateDataStoreLoaded; var isEmployeeExamDataStoreLoaded; var isEmployeeScholarshipDataStoreLoaded; var isEmployeeExternalWorkDataStoreLoaded; var isEmployeeOrganizationDataStoreLoaded; var isEmployeeMilitaryConscriptDataStoreLoaded; var isEmployeeAwardDataStoreLoaded; var isEmployeeLanguageDataStoreLoaded; var isEmployeeHobbyDataStoreLoaded; var isEmployeeHealthDataStoreLoaded; var isEmployeeReferenceDataStoreLoaded; var isEmployeeQuestionTaskDataStoreLoaded; var isEmployeeBankAccountDataStoreLoaded; var isEmployeeTaxAccountDataStoreLoaded; //#endregion //#region "Check All Datastore Loaded" function CheckAllDataStoreLoaded() { return ( isEmployeeContactDataStoreLoaded && isEmployeeAddressDataStoreLoaded && isEmployeeIdentificationDataStoreLoaded && isEmployeeFamilyDataStoreLoaded && isEmployeeReportingToSMSDataStoreLoaded && isEmployeeInternalWorkDataStoreLoaded && isEmployeeEmergencyAddressDataStoreLoaded && isEmployeeEmergencyDataStoreLoaded && isEmployeeEducationDataStoreLoaded && isEmployeeTrainingDataStoreLoaded && isEmployeeCertificateDataStoreLoaded && isEmployeeExamDataStoreLoaded && isEmployeeScholarshipDataStoreLoaded && isEmployeeExternalWorkDataStoreLoaded && isEmployeeOrganizationDataStoreLoaded && isEmployeeMilitaryConscriptDataStoreLoaded && isEmployeeAwardDataStoreLoaded && isEmployeeLanguageDataStoreLoaded && isEmployeeHobbyDataStoreLoaded && isEmployeeHealthDataStoreLoaded && isEmployeeReferenceDataStoreLoaded &&

isEmployeeQuestionTaskDataStoreLoaded && isEmployeeBankAccountDataStoreLoaded && isEmployeeTaxAccountDataStoreLoaded); } //#endregion //#region "Filter By First" function FilterdataByFirstLetter(firstLetter) { var prevPageIndexSize = employeeGridPagingCombo.getValue(); employeeDataStore.clearFilter(); employeeDataStore.filter('FirstName', firstLetter); employeeGridPagingCombo.setValue('500'); employeeDataStore.pageSize = employeeGridPagingCombo.getValue(); employeeDataStore.load(); employeeDataStore.clearFilter(); employeeGridPagingCombo.setValue(prevPageIndexSize); } //#endregion //#region "Set Initial Active Tab" function SetInitialActiveTab() { __IsBackgroundProcess = false; employeeWindow.ClearDataStore(); Ext.getCmp('employeeDetailForm').setActiveTab(Ext.getCmp('additionalInformat ionTabItem')); Ext.getCmp('additionalInformationPanel').setActiveTab(Ext.getCmp('languageAb ilityTabItem')); Ext.getCmp('employeeDetailForm').setActiveTab(Ext.getCmp('experiencesTabItem ')); Ext.getCmp('experiencesPanel').setActiveTab(Ext.getCmp('externalWorkingHisto ryTabItem')); Ext.getCmp('employeeDetailForm').setActiveTab(Ext.getCmp('educationTabItem') ); Ext.getCmp('educationPanel').setActiveTab(Ext.getCmp('educationalBackgroundT abItem')); Ext.getCmp('employeeDetailForm').setActiveTab(Ext.getCmp('financialDetailsTa bItem')); Ext.getCmp('financialDetailsPanel').setActiveTab(Ext.getCmp('salaryAndBenefi tsTabItem')); Ext.getCmp('employeeDetailForm').setActiveTab(Ext.getCmp('employmentDetailsT abItem')); Ext.getCmp('employmentDetailsPanel').setActiveTab(Ext.getCmp('employmentStat usTabItem')); Ext.getCmp('employeeDetailForm').setActiveTab(Ext.getCmp('familyStructuresPa nel')); Ext.getCmp('employeeDetailForm').setActiveTab(Ext.getCmp('generalPersonalDet ailsTabItem')); Ext.getCmp('generalPersonalDetailsPanel').setActiveTab(Ext.getCmp('personalD etailsTabItem')); topEmployeeForm.getForm().findField("EmployeeNoDisplay").setValue(''); topEmployeeForm.getForm().findField("FirstNameDisplay").setValue(''); topEmployeeForm.getForm().findField("LastNameDisplay").setValue(''); topEmployeeForm.getForm().findField("EmployeeNoDisplay").setDisabled(true);

//topEmployeeForm.getForm().findField("FirstNameDisplay").setDisabled(true); //topEmployeeForm.getForm().findField("LastNameDisplay").setDisabled(true); SetIsDisplayedFlag(false); __IsBackgroundProcess = true; _isAddInternalWorkFromCurrentEmployment = false; } //#endregion //#region "Add Internal Work History" function AddInternalWorkingHistory() { Ext.Msg.show({ title: 'Internal Working History Confirmation', buttons: Ext.MessageBox.YESNO, msg: 'Do you want to record the Working History for this employment and change last history end date?', fn: function (btn) { if (btn == 'yes') { var currentTime = new Date() var month = currentTime.getMonth() + 1 var day = currentTime.getDate() var year = currentTime.getFullYear() if (!isInternalWorkingHistoryTabShowed) { _isAddInternalWorkFromCurrentEmployment = true; isInternalWorkingHistoryTabShowed = true; FillData(10); } else { guid = new GUID(); guid.NewId(); var newInternalWorkingHistory = Ext.ModelManager.create( { Id: guid.Id, EmployeeNo: topEmployeeForm.getForm().findField("Employe eNoDisplay").getValue(), StartDate: year + '-' + month + '-' + day, //EndDate: year + '-' + month + '-' + day, DepartmentID: employeeInput.getForm().findField("Departm entID").getValue(), EmploymentTransferID: 0, OfficeLocationID: employeeInput.getForm().findField("Off iceLocationID").getValue(), EmploymentStatusID: employeeInput.getForm().findField("E mploymentStatusID").getValue(), JobTitleID: employeeInput.getForm().findField("JobTitleI D").getValue(), ReportingTo: employeeInput.getForm().findField("Reportin gTo").getValue(), DepartmentName: employeeInput.getForm().findField("Depar tmentName").getValue(), DivisionName: employeeInput.getForm().findField("Divisio nName").getValue(), GroupName: employeeInput.getForm().findField("GroupName" ).getValue(), EmploymentTransferName: '', OfficeLocationName: employeeInput.getForm().findField("O fficeLocationName").getValue(), EmploymentStatusName: employeeInput.getForm().findField(

"EmploymentStatusID").getRawValue(), JobTitleName: employeeInput.getForm().findField("JobTitl eID").getRawValue(), JobTitlePublish: employeeInput.getForm().findField("JobT itlePublish").getValue(), ReportingToName: employeeInput.getForm().findField("Repo rtingToName").getValue() }, 'EmployeeInternalWorkModel' ); //employeeInternalWorkDataStore.insert(0, newInternalWorking History); //selectedEmployeeInternalWorkRecord = employeeCertificateDa taStore.getAt(0); ShowUpdateEmployeeInternalWorkWithDefaultValueForm(employeeI nternalWorkDataStore, newInternalWorkingHistory); } } } }); } //#endregion //#region "Initialize Component" function InitializeWebControlComponent() { // Initialize ExtJS Ext.Loader.setConfig({ enabled: true }); Ext.Loader.setPath('Ext.ux', '../Lib/ExtJS/ext-4.0.2a/examples/ux'); Ext.require([ 'Ext.grid.*', 'Ext.data.*', 'Ext.util.*', 'Ext.state.*', 'Ext.form.*', 'Ext.toolbar.Paging', 'Ext.tip.QuickTipManager', 'Ext.selection.CellModel', 'Ext.ux.grid.FiltersFeature', 'Ext.ux.PreviewPlugin', 'Ext.ux.CheckColumn', 'Ext.ModelManager' ]); Ext.apply(Ext.form.VTypes, { emailText: "Not a valid email address. Must be in the following format: yourname@company.domain", emailRe: /^(\s*[a-zA-Z0-9\._%-]+@[a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4})\s*$/, email: function (v) { return v; //this.phoneRe.test(v); }, phoneText: "Not a valid phone number. Must be in the following format: 123-4567 or 123-456-7890.", phoneMask: /[d-]/, phoneRe: /^(\d{3}[-]?){1,2}(\d{4})$/, phone: function (v) { return v; //this.phoneRe.test(v); } });

Ext.onReady(function () { __IsBackgroundProcess = false; _isEmployeeWindowsMoving = true; Ext.tip.QuickTipManager.init(); ShowList(); CreateWindowForm(); __IsBackgroundProcess = true; }); window.onresize = function (event) { viewPort = new ViewPort(); viewPort.Calculate(); winWidth = viewPort.viewportwidth; winHeight = viewPort.viewportheight - FOOTER_HEIGHT - HEADER_HEIGHT; employeeGrid.setHeight(winHeight); employeeGrid.setWidth(winWidth); } } //#endregion //#region "Disable Inputs" function SetDisabledInputs(isDisable) { //ComboList employeeInput.getForm().findField('SalutationName').setReadOnly(isDisable); employeeInput.getForm().findField('BloodTypeID').setReadOnly(isDisable); employeeInput.getForm().findField('ReligionID').setReadOnly(isDisable); employeeInput.getForm().findField('EtnicID').setReadOnly(isDisable); employeeInput.getForm().findField('MaritalStatusIDEmployee').setReadOnly(isD isable); employeeInput.getForm().findField('EmergencyAddress_AddressStatus').setReadO nly(isDisable); employeeInput.getForm().findField('JobTitleID').setReadOnly(isDisable); employeeInput.getForm().findField('EmploymentStatusIDEmployee').setReadOnly( isDisable); employeeInput.getForm().findField('JobLevelIDEmployee').setReadOnly(isDisabl e); employeeInput.getForm().findField('JobGradeIDEmployee').setReadOnly(isDisabl e); employeeInput.getForm().findField('ReasonToResignIDEmployee').setReadOnl y(isDisable); employeeInput.getForm().findField('LastMainSalaryCurrency').setReadOnly(isDi sable); employeeInput.getForm().findField('ExpectedSalaryCurrency').setReadOnly(isDi sable); employeeInput.getForm().findField('LastBenefitsCurrency').setReadOnly(isDisa ble); employeeInput.getForm().findField('LastPerformanceBonusCurrency').setRea dOnly(isDisable); employeeInput.getForm().findField('LastAnnualBonusCurrency').setReadOnly(isD isable); employeeInput.getForm().findField('WorkSourceIDEmployee').setReadOnly(is Disable); employeeInput.getForm().findField('EmergencyAddress_RelationshipId').set ReadOnly(isDisable); //textfield employeeInput.getForm().findField('FirstName').setReadOnly(isDisable); employeeInput.getForm().findField('LastName').setReadOnly(isDisable);

employeeInput.getForm().findField('NickName').setReadOnly(isDisable); employeeInput.getForm().findField('EmergencyAddress_AddressName').setReadOnl y(isDisable); employeeInput.getForm().findField('EmergencyAddress_RTCode').setReadOnly(isD isable); employeeInput.getForm().findField('EmergencyAddress_RWCode').setReadOnly (isDisable); employeeInput.getForm().findField('EmergencyAddress_KelurahanName').setReadO nly(isDisable); employeeInput.getForm().findField('EmergencyAddress_KecamatanName').setReadO nly(isDisable); employeeInput.getForm().findField('EmergencyAddress_PostalCode').setReadOnly (isDisable); employeeInput.getForm().findField('EmergencyAddress_FaxNumber').setReadOnly( isDisable); employeeInput.getForm().findField('JobTitlePublish').setReadOnly(isDisab le); employeeInput.getForm().findField('BankAccount_IdentificationNo').setReadOnl y(isDisable); employeeInput.getForm().findField('TaxAccount_IdentificationNo').setReadOnly (isDisable); employeeInput.getForm().findField('ReasonToJoin').setReadOnly(isDisable); employeeInput.getForm().findField('OtherConsideration').setReadOnly(isDisabl e); employeeInput.getForm().findField('CareerObjectives').setReadOnly(isDisa ble); employeeInput.getForm().findField('ActiveDirectory').setReadOnly(isDisab le); employeeInput.getForm().findField('ActiveDirectory').setReadOnly(isDisab le); employeeInput.getForm().findField('EmergencyAddress_FirstName').setReadO nly(isDisable); employeeInput.getForm().findField('EmergencyAddress_LastName').setReadOn ly(isDisable); employeeInput.getForm().findField('EmergencyAddress_ContactNo').setReadO nly(isDisable); //RadioDroup employeeInput.getForm().findField('Gender_RadioGroup').setReadOnly(isDisable ); employeeInput.getForm().findField('IsWillingToTravel_RadioGroup').setReadOnl y(isDisable); employeeInput.getForm().findField('IsWillingToRelocated_RadioGroup').setRead Only(isDisable); employeeInput.getForm().findField('EmergencyAddress_Gender_RadioGroup').setR eadOnly(isDisable); // numberfield employeeInput.getForm().findField('Height').setReadOnly(isDisable); employeeInput.getForm().findField('Weight').setReadOnly(isDisable); employeeInput.getForm().findField('LastMainSalaryAmount').setReadOnly(isDisa ble); employeeInput.getForm().findField('LastAnnualBonusAmount').setReadOnly(isDis able); employeeInput.getForm().findField('LastPerformanceBonusAmount').setReadO nly(isDisable); employeeInput.getForm().findField('LastBenefitsAmount').setReadOnly(isDisabl e); employeeInput.getForm().findField('ExpectedSalaryAmount').setReadOnly(isDisa ble);

//DateField employeeInput.getForm().findField('ResignDate').setReadOnly(isDisable); employeeInput.getForm().findField('BirthDate').setReadOnly(isDisable); employeeInput.getForm().findField('MarriageDate').setReadOnly(isDisable); employeeInput.getForm().findField('JoinDate').setReadOnly(isDisable); employeeInput.getForm().findField('NoticePeriod').setReadOnly(isDisable) ; // button Ext.getCmp('employeePhoto-path').setVisible(!isDisable); Ext.getCmp('AddToInternalWorkingHistory').setVisible(!isDisable); Ext.getCmp('employeeBirthCityButton').setDisabled(isDisable); Ext.getCmp('employeeNationalityCountryButton').setDisabled(isDisable); Ext.getCmp('EmergencyAddress_CityButton').setDisabled(isDisable); Ext.getCmp('Employee_DepartmentButton').setDisabled(isDisable); Ext.getCmp('Employee_OfficeLocationButton').setDisabled(isDisable); Ext.getCmp('Employee_ReportingToButton').setDisabled(isDisable); Ext.getCmp('BankAccount_CityButton').setDisabled(isDisable); Ext.getCmp('TaxAccount_CityButton').setDisabled(isDisable); //BBar Ext.getCmp('employeeAddressGridBBar').setDisabled(isDisable); Ext.getCmp('employeeContactGridBBar').setDisabled(isDisable); Ext.getCmp('employeeIdentificationGridBBar').setDisabled(isDisable); Ext.getCmp('employeeNextOfKinGridBBar').setDisabled(isDisable); Ext.getCmp('employeeReportingToSMSGridBBar').setDisabled(isDisable); Ext.getCmp('employeeInternalWorkGridBBar').setDisabled(isDisable); Ext.getCmp('employeeEducationGridBBar').setDisabled(isDisable); Ext.getCmp('employeeTrainingGridBBar').setDisabled(isDisable); Ext.getCmp('employeeCertificateGridBBar').setDisabled(isDisable); Ext.getCmp('employeeScholarshipGridBBar').setDisabled(isDisable); Ext.getCmp('employeeExternalWorkGridBBar').setDisabled(isDisable); Ext.getCmp('employeeOrganizationGridBBar').setDisabled(isDisable); Ext.getCmp('employeeMilitaryConscriptGridBBar').setDisabled(isDisable); Ext.getCmp('employeeAwardGridBBar').setDisabled(isDisable); Ext.getCmp('employeeLanguageGridBBar').setDisabled(isDisable); Ext.getCmp('employeeHobbyGridBBar').setDisabled(isDisable); Ext.getCmp('employeeHealthGridBBar').setDisabled(isDisable); Ext.getCmp('employeeReferenceGridBBar').setDisabled(isDisable); Ext.getCmp('employeeQuestionTaskGridBBar').setDisabled(isDisable); Ext.getCmp('employeeExamGridBBar').setDisabled(isDisable); /* //employeeForm.doLayout(); */ } //#endregion //#region "Set Is Displayed Flag" function SetIsDisplayedFlag(flag) { isPersonalDetailsTabShowed = flag; isContactDetailsTabShowed = flag; isAddressesTabShowed = flag; isEmergencyAddressTabShowed = flag; isIdentityCardsTabShowed = flag; isFamilyStructuresTabShowed = flag; isEmploymentStatusTabShowed = flag; isResignationNoteTabShowed = flag;

isSMSForwardingToTabShowed = flag; isInternalWorkingHistoryTabShowed = flag; isSalaryandBenefitsTabShowed = flag; isBankAccountandTaxInfoTabShowed = flag; isEducationalBackgroundTabShowed = flag; isTrainingsandSeminardsTabShowed = flag; isProfesionalCertificatesTabShowed = flag; isProfesionalExamTabShowed = flag; isScholarshipsTabShowed = flag; isExternalWorkingHistoryTabShowed = flag; isSocialandPoliticalActivitiesTabShowed = flag; isMilitaryConscriptTabShowed = flag; isNonScholarshipAwardsTabShowed = flag; isLanguageAbilityTabShowed = flag; isHobbyTabShowed = flag; isMedicalRecordsTabShowed = flag; isReferenceDetailsTabShowed = flag; isQuestionnairesTabShowed = flag; isMiscellaneousInfoTabShowed = flag; isEmployeeContactDataStoreLoaded = flag; isEmployeeAddressDataStoreLoaded = flag; isEmployeeEmergencyAddressDataStoreLoaded = flag; isEmployeeIdentificationDataStoreLoaded = flag; isEmployeeBankAccountDataStoreLoaded = flag; isEmployeeTaxAccountDataStoreLoaded = flag; isEmployeeFamilyDataStoreLoaded = flag; isEmployeeReportingToSMSDataStoreLoaded = flag; isEmployeeInternalWorkDataStoreLoaded = flag; isEmployeeEducationDataStoreLoaded = flag; isEmployeeTrainingDataStoreLoaded = flag; isEmployeeCertificateDataStoreLoaded = flag; isEmployeeExamDataStoreLoaded = flag; isEmployeeScholarshipDataStoreLoaded = flag; isEmployeeExternalWorkDataStoreLoaded = flag; isEmployeeOrganizationDataStoreLoaded = flag; isEmployeeMilitaryConscriptDataStoreLoaded = flag; isEmployeeAwardDataStoreLoaded = flag; isEmployeeLanguageDataStoreLoaded = flag; isEmployeeHobbyDataStoreLoaded = flag; isEmployeeHealthDataStoreLoaded = flag; isEmployeeReferenceDataStoreLoaded = flag; isEmployeeQuestionTaskDataStoreLoaded = flag; isEmployeeEmergencyDataStoreLoaded = flag; } //#endregion //#region "GetUnfetchData" function GetUnfetchData() { if (!isPersonalDetailsTabShowed) FillData(1); if (!isContactDetailsTabShowed) FillData(2); if (!isAddressesTabShowed) FillData(3);

if (!isEmergencyAddressTabShowed) FillData(4); if (!isIdentityCardsTabShowed) FillData(5); if (!isFamilyStructuresTabShowed) FillData(6); if (!isEmploymentStatusTabShowed) FillData(7); if (!isResignationNoteTabShowed) FillData(8); if (!isSMSForwardingToTabShowed) FillData(9); if (!isInternalWorkingHistoryTabShowed) FillData(10); if (!isSalaryandBenefitsTabShowed) FillData(11); if (!isBankAccountandTaxInfoTabShowed) FillData(12); if (!isEducationalBackgroundTabShowed) FillData(13); if (!isTrainingsandSeminardsTabShowed) FillData(14); if (!isProfesionalCertificatesTabShowed) FillData(15); if (!isProfesionalExamTabShowed) FillData(16); if (!isScholarshipsTabShowed) FillData(17); if (!isExternalWorkingHistoryTabShowed) FillData(18); if (!isSocialandPoliticalActivitiesTabShowed) FillData(19); if (!isMilitaryConscriptTabShowed) FillData(20); if (!isNonScholarshipAwardsTabShowed) FillData(21); if (!isLanguageAbilityTabShowed) FillData(22); if (!isHobbyTabShowed) FillData(23);

if (!isMedicalRecordsTabShowed) FillData(24); if (!isReferenceDetailsTabShowed) FillData(25); if (!isQuestionnairesTabShowed) FillData(26); if (!isMiscellaneousInfoTabShowed) FillData(27); } //#endregion //#region "Show Message Form" function ShowMessageDialog(message) { Ext.Msg.show({ title: 'Confirmation', buttons: Ext.MessageBox.OK, msg: message, fn: function (btn) { if (btn == 'ok') { } } }); } //#endregion //#region "Show List Form" function ShowList() { winHeight = 0; winWidth = 0; viewPort = new ViewPort(); viewPort.Calculate(); winWidth = viewPort.viewportwidth; winHeight = viewPort.viewportheight - FOOTER_HEIGHT - HEADER_HEIGHT; CreateEmployeeModel(); CreateEmployeeDataStore(); CreateEmployeeGrid(winHeight); employeeDataStore.load(/*{ params: { start: 1, limit: 20 } }*/); } //#endregion //#region "Show Insert Form" function ShowInsertForm() { Ext.getCmp('addButton').show(); Ext.getCmp('updateButton').hide(); Ext.getCmp('cancelButton').show(); Ext.getCmp('closeButton').hide(); SetDisabledInputs(false); employeeWindow.setTitle("Add Employee"); //employeeInput.getForm().reset(); employeeWindow.show(); //SetInitialActiveTab();

SetIsDisplayedFlag(true); topEmployeeForm.getForm().findField("EmployeeNoDisplay").setDisabled(false); topEmployeeForm.getForm().findField("EmployeeNoDisplay").setReadOnly(false); __IsEditMode = true; _isInsertMode = true; global_cancelRefresh = true; } //#endregion //#region "Show Delete Dialog" function ShowDeleteDialog() { if (_SelectedEmployeeRecord != undefined) { Ext.Msg.show({ title: 'Delete Employee', buttons: Ext.MessageBox.YESNO, msg: 'Are You Sure Want To Delete NIK "' + _SelectedEmployeeRecord.E mployeeNo + '" ?', fn: function (btn) { if (btn == 'yes') { conn = new Ext.data.Connection(); conn.request({ url: '../handler/HRISHandler.aspx', params: { opr: '1004', Id: _SelectedEmployeeRecord.Id }, success: function (form, action) { employeeDataStore.load(); }, failure: function (form, action) { if (action.failureType === Ext.form.Action.CONNE CT_FAILURE) { Ext.Msg.alert('Failure', 'Server reported:' + action.response.status + ' ' + action.response.statusText); } if (action.failureType === Ext.form.Action.SERVE R_INVALID) { Ext.Msg.alert('Failed', action.result.errorm sg); } } }); } } }); } } //#endregion //#region "Show Update Form" function ShowUpdateForm() { if (_SelectedEmployeeRecord != undefined) { Ext.getCmp('addButton').hide(); Ext.getCmp('updateButton').show(); Ext.getCmp('cancelButton').show(); Ext.getCmp('closeButton').hide(); SetDisabledInputs(false); employeeWindow.setTitle("Update Employee Detail"); employeeWindow.show(); employeeWindow.setLoading(true);

FillData(1); FillData(0); __IsEditMode = true; _isInsertMode = false; global_cancelRefresh = true; } else { ShowMessageDialog("Select employee to update"); } } //#endregion //#region "Show Copy Form" function ShowCopyForm() { if (_SelectedEmployeeRecord != undefined) { Ext.getCmp('addButton').show(); Ext.getCmp('updateButton').hide(); Ext.getCmp('cancelButton').show(); Ext.getCmp('closeButton').hide(); SetDisabledInputs(false); employeeWindow.setTitle("Copy Employee Detail"); employeeInput.getForm().reset(); employeeWindow.show(); employeeWindow.setLoading(true); SetInitialActiveTab(); SetIsDisplayedFlag(true); for (var i=1;i<28;i++) FillData(i); topEmployeeForm.getForm().findField("EmployeeNoDisplay").setDisabled(fal se); topEmployeeForm.getForm().findField("EmployeeNoDisplay").setReadOnly(fal se); __IsEditMode = true; global_cancelRefresh = true; _isInsertMode = true; } else { ShowMessageDialog("Select employee to copy"); } } //#endregion //#region "Show View Form" function ShowViewForm() { if (_SelectedEmployeeRecord != undefined) { Ext.getCmp('addButton').hide(); Ext.getCmp('updateButton').hide(); Ext.getCmp('cancelButton').hide(); Ext.getCmp('closeButton').show(); SetDisabledInputs(true); employeeWindow.setTitle("View Employee Detail"); employeeWindow.show(); /* employeeWindow.header.el.on('click', function() { employeeWindow.animate({ to: { width: (employeeWindow.getWidth() == 500) ? 700 : 500, height: (employeeWindow.getHeight() == 300) ? 400 : 300, } }); }); */

SetInitialActiveTab(); FillData(1); FillData(0); __IsEditMode = false; _isInsertMode = false; } else { ShowMessageDialog("Select employee to see the details"); } } //#endregion //#region "Create Employee Model" function CreateEmployeeModel() { //#region "Create Employee Model" if (!Ext.ModelManager.isRegistered('EmployeeModel')) { Ext.define("EmployeeModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'Gender', type: 'bool' }, { name: 'IsDeleted', type: 'bool' }, { name: 'IsWillingToRelocated', type: 'bool' }, { name: 'IsWillingToTravel', type: 'bool' }, { name: 'BirthDate', type: 'date' }, { name: 'CreatedDateTime', type: 'date' }, { name: 'JoinDate', type: 'date' }, { name: 'LastModifiedDateTime', type: 'date' }, { name: 'MarriageDate', type: 'date' }, { name: 'NoticePeriod', type: 'date' }, { name: 'ResignDate', type: 'date' }, { name: 'ExpectedSalaryAmount', type: 'float' }, { name: 'LastAnnualBonusAmount', type: 'float' }, { name: 'LastBenefitsAmount', type: 'float' }, { name: 'LastMainSalaryAmount', type: 'float' }, { name: 'LastPerformanceBonusAmount', type: 'float' }, { name: 'BirthCityID', type: 'int' }, { name: 'BloodTypeID', type: 'int' }, { name: 'DepartmentID', type: 'int' }, { name: 'EmploymentStatusID', type: 'int' }, { name: 'EtnicID', type: 'int' }, { name: 'Height', type: 'int' }, { name: 'JobGradeID', type: 'int' }, { name: 'JobLevelID', type: 'int' }, { name: 'JobTitleID', type: 'int' }, { name: 'MaritalStatusID', type: 'int' }, { name: 'NationalityCountryID', type: 'int' }, { name: 'OfficeLocationID', type: 'int' }, { name: 'PositionInFamily', type: 'int' }, { name: 'ReasonToResignID', type: 'int' }, { name: 'ReligionID', type: 'int' }, { name: 'Weight', type: 'int' }, { name: 'WorkSourceID', type: 'int' }, { name: 'ActiveDirectory', type: 'string' }, { name: 'BirthCityName', type: 'string' }, { name: 'BirthCountryName', type: 'string' }, { name: 'BirthProvinceStateName', type: 'string' }, { name: 'BloodTypeName', type: 'string' }, { name: 'CareerObjectives', type: 'string' }, { name: 'CreatedBy', type: 'string' }, { name: 'DepartmentName', type: 'string' },

{ { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { }); } //#endregion } //#endregion

name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name: name:

'DivisionName', type: 'string' }, 'EmployeeNo', type: 'string' }, 'EmploymentStatusName', type: 'string' }, 'EtnicName', type: 'string' }, 'ExpectedSalaryCurrency', type: 'string' }, 'FirstName', type: 'string' }, 'GroupName', type: 'string' }, 'JobGradeName', type: 'string' }, 'JobLevelName', type: 'string' }, 'JobTitleName', type: 'string' }, 'JobTitlePublish', type: 'string' }, 'LastAnnualBonusCurrency', type: 'string' }, 'LastBenefitsCurrency', type: 'string' }, 'LastMainSalaryCurrency', type: 'string' }, 'LastModifiedBy', type: 'string' }, 'LastName', type: 'string' }, 'LastPerformanceBonusCurrency', type: 'string' }, 'MaritalStatusName', type: 'string' }, 'NationalityCountryName', type: 'string' }, 'NickName', type: 'string' }, 'OfficeLocationName', type: 'string' }, 'OtherConsideration', type: 'string' }, 'PictureFile', type: 'string' }, 'ReasonToJoin', type: 'string' }, 'ReasonToResignName', type: 'string' }, 'ReligionName', type: 'string' }, 'ReportingTo', type: 'string' }, 'ReportingToName', type: 'string' }, 'SalutationName', type: 'string' }, 'WorkSourceName', type: 'string' }, 'Email', type: 'string' }

], idProperty: 'Id'

//#region "Create Employee DataStore" function CreateEmployeeDataStore() { employeeDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx?opr=1001', reader: { type: 'json', root: 'Employee', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC'

}], remoteSort: true, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, sortInfo: { field: 'CURRENCYCODE', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'beforeload': { fn: function (store, options, continueFlag) { //alert(options.filters.length); }, scope: this } }, pageSize: 25, storeId: 'employeeDataStore', model: 'EmployeeModel', waitMsg: 'Loading...' }); } //#endregion //#region "Create Employee Grid" function CreateEmployeeGrid(winHeight) { employeeGridPagingCombo = new Ext.form.ComboBox({ name: 'employeeGridPagingCombo', width: 50, store: new Ext.data.ArrayStore({ fields: ['id'], data: [ ['25'], ['50'], ['100'], ['200'], ['500'] ] }), mode: 'local', value: '25', listWidth: 40, triggerAction: 'all', displayField: 'id', valueField: 'id', editable: false, forceSelection: true }); //#region "Create Context Menu" listContextMenu = new Ext.menu.Menu({ items: [{ id: 'list-record-add',

iconCls: 'grid-add-icon', text: 'Add' }, { id: 'list-record-update', iconCls: 'grid-update-icon', text: 'Update' }, { id: 'list-record-delete', iconCls: 'grid-delete-icon', text: 'Delete' }, '-', { id: 'list-record-view', iconCls: 'grid-view-icon', text: 'View' }, '-', { id: 'list-record-copy', iconCls: 'grid-add-icon', text: 'Copy' }], listeners: { click: function (menu, item, e, options) { switch (item.id) { case 'list-record-delete': ShowDeleteDialog(); break; case 'list-record-update': ShowUpdateForm(); break; case 'list-record-add': ShowInsertForm(); break; case 'list-record-view': ShowViewForm(); break; case 'list-record-copy': ShowCopyForm() break; default: break; } } } }); //#endregion //#region "Create Employee Grid Filters" employeeGridFilters = { ftype: 'filters', encode: true, local: false, filters: [ { type: 'string', dataIndex: 'EmployeeNo' }, { type: 'string', dataIndex: 'FirstName' }, {

type: 'string', dataIndex: 'LastName' }, { type: 'string', dataIndex: 'BirthCityName' },{ dataIndex: 'BirthDate', type: 'date' }, { dataIndex: 'JoinDate', type: 'date' }, { type: 'string', dataIndex: 'Gender' }, { type: 'string', dataIndex: 'DepartmentName' }, { type: 'string', dataIndex: 'OfficeLocationName' }, { type: 'string', dataIndex: 'EmploymentStatusName' }, { type: 'string', dataIndex: 'EmploymentStatusName' } ] }; //#endregion //#region "Create Employee Grid Columns" employeeGridColumns = [ /*{ id: 'PictureFile', dataIndex: 'PictureFile', text: "Photo", width: 320, height:60, renderer: function PictureFile(val) { return '<img src="../image/' + val + '" width="113">'; } },*/ { dataIndex: 'EmployeeNo', id: 'EmployeeNo', text: "NIK", width: 60, sortable: true, filterable: true, filter: { type: 'string' } }, { id: 'FirstNameEmployee', dataIndex: 'FirstName', text: "First Name", flex: 1, sortable: true, filterable: true, filter: { type: 'string' } }, {

id: 'LastNameEmployee', dataIndex: 'LastName', text: "Last Name", flex: 1, sortable: true, filterable: true, filter: { type: 'string' } }, { id: 'GenderEmployee', dataIndex: 'Gender', text: "Gender", width: 80, sortable: true, filterable: true, filter: { type: 'string' }, renderer: function gender(val, x, store) { if (!val) return 'Female' ; else return 'Male'; } }, { dataIndex: 'BirthCityName', id: 'BirthCityName', text: "Birth City", flex: 1, sortable: true, filterable: true, filter: { type: 'string' } }, { id: 'BirthDateEmployee', text: "Birth Date", dataIndex: 'BirthDate', width: 70, sortable: true, format: 'd/m/Y', filterable: true, renderer: Ext.util.Format.dateRenderer('d/m/Y'), filter: { type: 'date' } }, { id: 'JoinDate', text: "Join Date", dataIndex: 'JoinDate', width: 70, sortable: true, format: 'd/m/Y', filterable: true, renderer: Ext.util.Format.dateRenderer('d/m/Y'), filter: { type: 'date' } }, { dataIndex: 'DepartmentName', id: 'DepartmentName', text: "Department", flex: 1, sortable: true, filterable: true, filter: { type: 'string' } }, { dataIndex: 'OfficeLocationName', id: 'OfficeLocation', text: "Office Location",

flex: 1, sortable: true, filterable: true, filter: { type: 'string' } }, { id: 'EmploymentStatusName', dataIndex: 'EmploymentStatusName', text: "Employment Status", flex: 1, sortable: true, filterable: true, filter: { type: 'string' } } ]; //#endregion var employeeGridBBar = new Ext.PagingToolbar({ store: employeeDataStore, //the store you use in your grid displayInfo: true, displayMsg: 'Displaying employee(s) {0} - {1} of {2}', emptyMsg: "No employee to display", items: [ '-', 'Per Page: ', employeeGridPagingCombo ] }); employeeGridPagingCombo.on('select', function (combo, record) { employeeDataStore.pageSize = employeeGridPagingCombo.getValue(); //parseInt(employeeGridPagingCombo.getValue(), 25); // parseInt(record.get('id') , 10); //alert(employeeDataStore.pageSize); employeeDataStore.load(); }, this); //#region "Create Employee Grid" employeeGrid = Ext.create('Ext.grid.Panel', { store: employeeDataStore, id: 'employeeGrid', renderTo: 'ContentDetailPanelFrom', border: 0, width: '100%', height: winHeight, disableSelection: false, features: [employeeGridFilters], loadMask: true, columnLines: true, autoScroll: true, viewConfig: { trackOver: false, stripeRows: true }, listeners: { itemdblclick: function (dv, record, item, index, e) { _SelectedEmployeeRecord = record.data; ShowViewForm();

} }, columns: employeeGridColumns, bbar: employeeGridBBar /*Ext.create('Ext.PagingToolbar', { store: employeeDataStore, displayInfo: true, displayMsg: 'Displaying employee(s) {0} - {1} of {2}', emptyMsg: "No employee to display", items : [ '-', 'Per Page: ', employeeGridPagingCombo ] })*/, //#region "Quick Link" dockedItems: [{ xtype: 'toolbar', items: [ '->', { xtype: 'box', name: 'QuickFilterLabel', autoEl: { tag: '', cn: 'Quick Filter :&nbsp;&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_B', autoEl: { tag: 'a', href: '#', cn: 'A', onclick: "FilterdataByFirstLetter('A');" } }, { xtype: 'box', name: 'SepearatorAlphabet1', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_B', autoEl: { tag: 'a', href: '#', cn: 'B', onclick: "FilterdataByFirstLetter('B');" } }, { xtype: 'box', name: 'SepearatorAlphabet2', autoEl: {

tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_C', autoEl: { tag: 'a', href: '#', cn: 'C', onclick: "FilterdataByFirstLetter('C');" } }, { xtype: 'box', name: 'SepearatorAlphabet3', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_D', autoEl: { tag: 'a', href: '#', cn: 'D', onclick: "FilterdataByFirstLetter('D');" } }, { xtype: 'box', name: 'SepearatorAlphabet4', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_E', autoEl: { tag: 'a', href: '#', cn: 'E', onclick: "FilterdataByFirstLetter('E');" } }, { xtype: 'box', name: 'SepearatorAlphabet5', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box',

name: 'FilterByAlphabet_F', autoEl: { tag: 'a', href: '#', cn: 'F', onclick: "FilterdataByFirstLetter('F');" } }, { xtype: 'box', name: 'SepearatorAlphabet6', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_G', autoEl: { tag: 'a', href: '#', cn: 'G', onclick: "FilterdataByFirstLetter('G');" } }, { xtype: 'box', name: 'SepearatorAlphabet7', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_H', autoEl: { tag: 'a', href: '#', cn: 'H', onclick: "FilterdataByFirstLetter('H');" } }, { xtype: 'box', name: 'SepearatorAlphabet8', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_I', autoEl: { tag: 'a', href: '#', cn: 'I', onclick: "FilterdataByFirstLetter('I');"

} }, { xtype: 'box', name: 'SepearatorAlphabet9', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_J', autoEl: { tag: 'a', href: '#', cn: 'J', onclick: "FilterdataByFirstLetter('J');" } }, { xtype: 'box', name: 'SepearatorAlphabet10', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_K', autoEl: { tag: 'a', href: '#', cn: 'K', onclick: "FilterdataByFirstLetter('K');" } }, { xtype: 'box', name: 'SepearatorAlphabet11', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_L', autoEl: { tag: 'a', href: '#', cn: 'L', onclick: "FilterdataByFirstLetter('L');" } }, { xtype: 'box', name: 'SepearatorAlphabet12', autoEl: {

tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_M', autoEl: { tag: 'a', href: '#', cn: 'M', onclick: "FilterdataByFirstLetter('M');" } }, { xtype: 'box', name: 'SepearatorAlphabet13', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_N', autoEl: { tag: 'a', href: '#', cn: 'N', onclick: "FilterdataByFirstLetter('N');" } }, { xtype: 'box', name: 'SepearatorAlphabet14', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_O', autoEl: { tag: 'a', href: '#', cn: 'O', onclick: "FilterdataByFirstLetter('O');" } }, { xtype: 'box', name: 'SepearatorAlphabet15', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box',

name: 'FilterByAlphabet_P', autoEl: { tag: 'a', href: '#', cn: 'P', onclick: "FilterdataByFirstLetter('P');" } }, { xtype: 'box', name: 'SepearatorAlphabet16', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_Q', autoEl: { tag: 'a', href: '#', cn: 'Q', onclick: "FilterdataByFirstLetter('Q');" } }, { xtype: 'box', name: 'SepearatorAlphabet17', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_R', autoEl: { tag: 'a', href: '#', cn: 'R', onclick: "FilterdataByFirstLetter('R');" } }, { xtype: 'box', name: 'SepearatorAlphabet18', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_S', autoEl: { tag: 'a', href: '#', cn: 'S', onclick: "FilterdataByFirstLetter('S');"

} }, { xtype: 'box', name: 'SepearatorAlphabet18', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_T', autoEl: { tag: 'a', href: '#', cn: 'T', onclick: "FilterdataByFirstLetter('T');" } }, { xtype: 'box', name: 'SepearatorAlphabet10', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_U', autoEl: { tag: 'a', href: '#', cn: 'U', onclick: "FilterdataByFirstLetter('U');" } }, { xtype: 'box', name: 'SepearatorAlphabet21', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_V', autoEl: { tag: 'a', href: '#', cn: 'V', onclick: "FilterdataByFirstLetter('V');" } }, { xtype: 'box', name: 'SepearatorAlphabet22', autoEl: {

tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_W', autoEl: { tag: 'a', href: '#', cn: 'W', onclick: "FilterdataByFirstLetter('W');" } }, { xtype: 'box', name: 'SepearatorAlphabet23', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_X', autoEl: { tag: 'a', href: '#', cn: 'X', onclick: "FilterdataByFirstLetter('X');" } }, { xtype: 'box', name: 'SepearatorAlphabet24', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'FilterByAlphabet_Y', autoEl: { tag: 'a', href: '#', cn: 'Y', onclick: "FilterdataByFirstLetter('Y');" } }, { xtype: 'box', name: 'SepearatorAlphabet25', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box',

name: 'FilterByAlphabet_Z', autoEl: { tag: 'a', href: '#', cn: 'Z', onclick: "FilterdataByFirstLetter('Z');" } }, { xtype: 'box', name: 'SepearatorAlphabet26', autoEl: { tag: '', cn: '&nbsp;&nbsp;' } }, { xtype: 'box', name: 'SepearatorAlphabet27', autoEl: { tag: '', cn: '' } }] }] //#endregion }); //#endregion //#region add some buttons to bottom toolbar employeeGrid.child('[dock=bottom]').add([ '->', { text: 'Clear Filter Data', tooltip: 'Clear Filter Data', handler: function () { employeeGrid.filters.clearFilters(); } } ]); //#endregion //#region "update panel body on selection change" employeeGrid.getSelectionModel().on('selectionchange', function (sm, selecte dRecord) { if (selectedRecord.length) { _SelectedEmployeeRecord = selectedRecord[0].data; } }); //#endregion //#region "Attach Context Menu to Grid" employeeGrid.on('itemcontextmenu', function (obj, record, item, index, e, op tions) { _SelectedEmployeeRecord = record.data; e.stopEvent(); listContextMenu.showAt(e.xy); }); //#endregion

} //#endregion //#region "Create Data Model" function CreateDataModel() { //#region "Create Employee Address Model" if (!Ext.ModelManager.isRegistered('EmployeeAddressModel')) { Ext.define("EmployeeAddressModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'CityID', type: 'int' }, { name: 'AddressTypeID', type: 'int' }, { name: 'AddressStatusID', type: 'int' }, { name: 'EmployeeNextOfKinID', type: 'string' }, { name: 'AddressName', type: 'string' }, { name: 'KelurahanName', type: 'string' }, { name: 'KecamatanName', type: 'string' }, { name: 'ProvinceStateName', type: 'string' }, { name: 'CountryName', type: 'string' }, { name: 'CityName', type: 'string' }, { name: 'AddressTypeName', type: 'string' }, { name: 'AddressStatusName', type: 'string' }, { name: 'NextOfKinName', type: 'string' }, { name: 'AddressContact', type: 'string' }, { name: 'RTCode', type: 'string' }, { name: 'RWCode', type: 'string' }, { name: 'PostalCode', type: 'string' }, { name: 'FaxNumber', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create Employee Address Contact Model" if (!Ext.ModelManager.isRegistered('EmployeeAddressContactModel')) { Ext.define("EmployeeAddressContactModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'EmployeeAddressId', type: 'string' }, { name: 'EmployeeAddressName', type: 'string' }, { name: 'ContactNumber', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create Employee Award Model" if (!Ext.ModelManager.isRegistered('EmployeeAwardModel')) { Ext.define("EmployeeAwardModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' },

{ { { { { }); } //#endregion

name: name: name: name: name:

'EmployeeNo', type: 'string' }, 'GivenDate', type: 'date' }, 'InstitutionName', type: 'string' }, 'AwardName', type: 'string' }, 'AwardDescription', type: 'string' }

], idProperty: 'Id'

//#region "Create Employee Certificate Model" if (!Ext.ModelManager.isRegistered('EmployeeCertificateModel')) { Ext.define("EmployeeCertificateModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'CertificateID', type: 'int' }, { name: 'CertificateLevelID', type: 'int' }, { name: 'SpecialityTypeID', type: 'int' }, { name: 'TakenDate', type: 'date' }, { name: 'ExpireDate', type: 'date' }, { name: 'CityID', type: 'int' }, { name: 'CertificateIssuerID', type: 'int' }, { name: 'Grade', type: 'string' }, { name: 'Score', type: 'float' }, { name: 'IsPassed', type: 'bool' }, { name: 'IsExam', type: 'bool' }, { name: 'CertificateName', type: 'string' }, { name: 'CertificateIssuerName', type: 'string' }, { name: 'CertificateLevelName', type: 'string' }, { name: 'CertificateInstitutionName', type: 'string' }, { name: 'CityName', type: 'string' }, { name: 'ProvinceStateName', type: 'string' }, { name: 'CountryName', type: 'string' }, { name: 'SpecialityTypeName', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create Employee Exam Model" if (!Ext.ModelManager.isRegistered('EmployeeExamModel')) { Ext.define("EmployeeExamModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'ExamID', type: 'int' }, { name: 'TakenDate', type: 'date' }, { name: 'ExpireDate', type: 'date' }, { name: 'CityID', type: 'int' }, { name: 'CertificateIssuerID', type: 'int' }, { name: 'Grade', type: 'string' }, { name: 'Score', type: 'float' }, { name: 'IsPassed', type: 'bool' }, { name: 'ExamName', type: 'string' }, { name: 'CertificateIssuerName', type: 'string' },

{ name: 'CityName', type: 'string' }, { name: 'ProvinceStateName', type: 'string' }, { name: 'CountryName', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create Employee Contact Model" if (!Ext.ModelManager.isRegistered('EmployeeContactModel')) { Ext.define("EmployeeContactModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'ContactTypeID', type: 'int' }, { name: 'ContactTypeName', type: 'string' }, { name: 'ContactNo', type: 'string' }, { name: 'IsSMSReport', type: 'bool' } ], idProperty: 'Id' }); } //#endregion //#region "Create Employee Education Model" if (!Ext.ModelManager.isRegistered('EmployeeEducationModel')) { Ext.define("EmployeeEducationModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'EducationTypeID', type: 'int' }, { name: 'EducationDegreeID', type: 'int' }, { name: 'StartDate', type: 'date' }, { name: 'EndDate', type: 'date' }, { name: 'EducationInstitutionName', type: 'string' }, { name: 'CityID', type: 'int' }, { name: 'FacultyName', type: 'string' }, { name: 'MajorName', type: 'string' }, { name: 'Grade', type: 'float' }, { name: 'EducationTitle', type: 'string' }, { name: 'IsGraduated', type: 'bool' }, { name: 'IsDropOut', type: 'bool' }, { name: 'EducationTypeName', type: 'string' }, { name: 'EducationDegreeName', type: 'string' }, { name: 'CityName', type: 'string' }, { name: 'ProvinceStateName', type: 'string' }, { name: 'CountryName', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create Employee External Work Model" if (!Ext.ModelManager.isRegistered('EmployeeExternalWorkModel')) { Ext.define("EmployeeExternalWorkModel", { extend: "Ext.data.Model",

fields: [ { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: ], idProperty: }); } //#endregion

'Id', type: 'string' }, 'EmployeeNo', type: 'string' }, 'StartDate', type: 'date' }, 'EndDate', type: 'date' }, 'CityID', type: 'int' }, 'LineOfBusinessID', type: 'int' }, 'SalaryAmount', type: 'float' }, 'SalaryCurrencyCode', type: 'string' }, 'NumberOfSubordinate', type: 'int' }, 'ReasonToLeave', type: 'string' }, 'JobTitleName', type: 'string' }, 'CompanyName', type: 'string' }, 'SupervisorTitleName', type: 'string' }, 'CityName', type: 'string' }, 'ProvinceStateName', type: 'string' }, 'CountryName', type: 'string' }, 'LineOfBusinessName', type: 'string' }, 'SupervisorName', type: 'string' } 'Id'

//#region "Create Employee Health Model" if (!Ext.ModelManager.isRegistered('EmployeeHealthModel')) { Ext.define("EmployeeHealthModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'StartDate', type: 'date' }, { name: 'EndDate', type: 'date' }, { name: 'IllnessName', type: 'string' }, { name: 'IllnessDescription', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create Employee Hobby Model" if (!Ext.ModelManager.isRegistered('EmployeeHobbyModel')) { Ext.define("EmployeeHobbyModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'HobbyTypeID', type: 'int' }, { name: 'HobbyTypeName', type: 'string' }, { name: 'HobbyName', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create Employee Identification Model" if (!Ext.ModelManager.isRegistered('EmployeeIdentificationModel')) {

Ext.define("EmployeeIdentificationModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'IdentificationTypeID', type: 'int' }, { name: 'IdentificationTypeName', type: 'string' }, { name: 'CityID', type: 'int' }, { name: 'CityName', type: 'string' }, { name: 'ProvinceStateName', type: 'string' }, { name: 'CountryName', type: 'string' }, { name: 'IdentificationNo', type: 'string' }, { name: 'StartDate', type: 'date' }, { name: 'ExpiredDate', type: 'date' } ], idProperty: 'Id' }); } //#endregion //#region "Create Employee Internal Work Model" if (!Ext.ModelManager.isRegistered('EmployeeInternalWorkModel')) { Ext.define("EmployeeInternalWorkModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'StartDate', type: 'date' }, { name: 'EndDate', type: 'date' }, { name: 'DepartmentID', type: 'int' }, { name: 'EmploymentTransferID', type: 'int' }, { name: 'OfficeLocationID', type: 'int' }, { name: 'EmploymentStatusID', type: 'int' }, { name: 'JobTitleID', type: 'int' }, { name: 'ReportingTo', type: 'string' }, { name: 'DepartmentName', type: 'string' }, { name: 'DivisionName', type: 'string' }, { name: 'GroupName', type: 'string' }, { name: 'EmploymentTransferName', type: 'string' }, { name: 'OfficeLocationName', type: 'string' }, { name: 'EmploymentStatusName', type: 'string' }, { name: 'JobTitleName', type: 'string' }, { name: 'JobTitlePublish', type: 'string' }, { name: 'ReportingToName', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create Employee Language Model" if (!Ext.ModelManager.isRegistered('EmployeeLanguageModel')) { Ext.define("EmployeeLanguageModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'LanguageID', type: 'int' }, { name: 'ReadingProficiencyID', type: 'int' }, { name: 'WrittingProficiencyID', type: 'int' },

{ { { { { { { }); } //#endregion

name: name: name: name: name: name: name:

'SpeakingProficiencyID', type: 'int' }, 'ListeningProficiencyID', type: 'int' }, 'LanguageName', type: 'string' }, 'ReadingProficiency', type: 'string' }, 'WrittingProficiency', type: 'string' }, 'SpeakingProficiency', type: 'string' }, 'ListeningProficiency', type: 'string' }

], idProperty: 'Id'

//#region "Create Employee Leave Model" if (!Ext.ModelManager.isRegistered('EmployeeLeaveModel')) { Ext.define("EmployeeLeaveModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'StartDate', type: 'date' }, { name: 'EndDate', type: 'date' }, { name: 'LeaveID', type: 'int' }, { name: 'LeaveName', type: 'string' }, { name: 'Reason', type: 'string' }, { name: 'NoOfDays', type: 'int' } ], idProperty: 'Id' }); } //#endregion //#region "Create Employee Military Conscript Model" if (!Ext.ModelManager.isRegistered('EmployeeMilitaryConscriptModel')) { Ext.define("EmployeeMilitaryConscriptModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'StartDate', type: 'date' }, { name: 'EndDate', type: 'date' }, { name: 'MilitaryBranchID', type: 'int' }, { name: 'MilitaryBranchName', type: 'string' }, { name: 'CityID', type: 'int' }, { name: 'CityName', type: 'string' }, { name: 'ProvinceStateName', type: 'string' }, { name: 'CountryName', type: 'string' }, { name: 'HighestRank', type: 'string' }, { name: 'AssignedTo', type: 'string' }, { name: 'Remark', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create Employee NextOfKin Model" if (!Ext.ModelManager.isRegistered('EmployeeNextOfKinModel')) { Ext.define("EmployeeNextOfKinModel", { extend: "Ext.data.Model",

fields: [ { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: { name: ], idProperty: }); } //#endregion

'Id', type: 'string' }, 'EmployeeNo', type: 'string' }, 'EmployeeNextOfKinID', type: 'int' }, 'RelationshipID', type: 'int' }, 'FirstName', type: 'string' }, 'LastName', type: 'string' }, 'Gender', type: 'bool' }, 'BirthDate', type: 'date' }, 'BirthCityID', type: 'int' }, 'EducationTypeID', type: 'int' }, 'LineOfBusinessID', type: 'int' }, 'isPPHfactor', type: 'bool' }, 'WorkAtCompanyName', type: 'string' }, 'NationalityCountryID', type: 'int' }, 'IsDeceased', type: 'bool' }, 'LastJob', type: 'string' }, 'LineOfBusinessName', type: 'string' }, 'EducationTypeName', type: 'string' }, 'BirthProvinceStateName', type: 'string' }, 'BirthCountryName', type: 'string' }, 'BirthCityName', type: 'string' }, 'RelationshipName', type: 'string' }, 'NationalityName', type: 'string' } 'Id'

//#region "Create EmployeeOrganization Model" if (!Ext.ModelManager.isRegistered('EmployeeOrganizationModel')) { Ext.define("EmployeeOrganizationModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'OrganizationFieldID', type: 'int' }, { name: 'OrganizationFieldName', type: 'string' }, { name: 'CityID', type: 'int' }, { name: 'CityName', type: 'string' }, { name: 'ProvinceStateName', type: 'string' }, { name: 'CountryName', type: 'string' }, { name: 'StartDate', type: 'date' }, { name: 'EndDate', type: 'date' }, { name: 'OrganizationName', type: 'string' }, { name: 'Position', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create EmployeePermission Model" if (!Ext.ModelManager.isRegistered('EmployeePermissionModel')) { Ext.define("EmployeePermissionModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' },

{ { { { { { { }); } //#endregion

name: name: name: name: name: name: name:

'PhoneNo', type: 'string' }, 'PermissionDate', type: 'date' }, 'PermissionTypeID', type: 'int' }, 'PermissionTypeName', type: 'string' }, 'PermissionPlaceName', type: 'string' }, 'PermissionCityName', type: 'string' }, 'PermissionDescription', type: 'string' }

], idProperty: 'Id'

//#region "Create EmployeeQuestionTask Model" if (!Ext.ModelManager.isRegistered('EmployeeQuestionTaskModel')) { Ext.define("EmployeeQuestionTaskModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'QuestionTaskID', type: 'int' }, { name: 'QuestionTaskDescription', type: 'string' }, { name: 'AnswerDescription', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create EmployeeReference Model" if (!Ext.ModelManager.isRegistered('EmployeeReferenceModel')) { Ext.define("EmployeeReferenceModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'FirstName', type: 'string' }, { name: 'LastName', type: 'string' }, { name: 'ContactNumber', type: 'string' }, { name: 'EmailAddress', type: 'string' }, { name: 'CityID', type: 'int' }, { name: 'CityName', type: 'string' }, { name: 'ProvinceStateName', type: 'string' }, { name: 'CountryName', type: 'string' }, { name: 'PostalCode', type: 'string' }, { name: 'ReferenceAddress', type: 'string' }, { name: 'YearKnown', type: 'int' }, { name: 'IsContactable', type: 'bool' }, { name: 'CompanyName', type: 'string' }, { name: 'JobTitleName', type: 'string' }, { name: 'ReferenceRelation', type: 'string' }, { name: 'NationalityCountryID', type: 'int' }, { name: 'NationalityName', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create EmployeeReportingToSMS Model"

if (!Ext.ModelManager.isRegistered('EmployeeReportingToSMSModel')) { Ext.define("EmployeeReportingToSMSModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'ReportSMSEmployeeNo', type: 'string' }, { name: 'ReportingToName', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create EmployeeScholarship Model" if (!Ext.ModelManager.isRegistered('EmployeeScholarshipModel')) { Ext.define("EmployeeScholarshipModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'StartDate', type: 'date' }, { name: 'EndDate', type: 'date' }, { name: 'InstitutionName', type: 'string' }, { name: 'ScholarshipName', type: 'string' }, { name: 'PromotorName', type: 'string' }, { name: 'ScholarshipDescription', type: 'string' } ], idProperty: 'Id' }); } //#endregion //#region "Create EmployeeTraining Model" if (!Ext.ModelManager.isRegistered('EmployeeTrainingModel')) { Ext.define("EmployeeTrainingModel", { extend: "Ext.data.Model", fields: [ { name: 'Id', type: 'string' }, { name: 'EmployeeNo', type: 'string' }, { name: 'CityID', type: 'int' }, { name: 'TrainingTypeID', type: 'int' }, { name: 'CityName', type: 'string' }, { name: 'ProvinceStateName', type: 'string' }, { name: 'CountryName', type: 'string' }, { name: 'TrainingTypeName', type: 'string' }, { name: 'StartDate', type: 'date' }, { name: 'EndDate', type: 'date' }, { name: 'PromotorName', type: 'string' }, { name: 'SponsorName', type: 'string' }, { name: 'TrainingFee', type: 'float' }, { name: 'TrainingFeeCurrency', type: 'string' }, { name: 'TrainingName', type: 'string' }, { name: 'Remark', type: 'string' }, { name: 'InstructorName', type: 'string' }, { name: 'IsExternal', type: 'bool' } ], idProperty: 'Id' }); }

//#endregion //#region "Create Blood Type Model" if (!Ext.ModelManager.isRegistered('bloodTypeModel')) { Ext.define("bloodTypeModel", { extend: "Ext.data.Model", fields: [ { name: 'BloodTypeID', type: 'int' }, { name: 'BloodTypeName', type: 'string' }, ], idProperty: 'BloodTypeID' }); } //#endregion //#region "Create Religion Model" if (!Ext.ModelManager.isRegistered('religionModel')) { Ext.define("religionModel", { extend: "Ext.data.Model", fields: [{ name: 'ReligionID', type: 'int' }, { name: 'ReligionName', type: 'string' } ], idProperty: 'ReligionID' }); } //#endregion //#region "Create Etnic Model" if (!Ext.ModelManager.isRegistered('etnicModel')) { Ext.define("etnicModel", { extend: "Ext.data.Model", fields: [{ name: 'EtnicID', type: 'int' }, { name: 'EtnicName', type: 'string' } ], idProperty: 'EtnicID' }); } //#endregion //#region "Create Marital Status Model" if (!Ext.ModelManager.isRegistered('maritalStatusModel')) { Ext.define("maritalStatusModel", { extend: "Ext.data.Model", fields: [ { name: 'MaritalStatusID', type: 'int' }, { name: 'MaritalStatusName', type: 'string' }, { name: 'IsMarital', type: 'boolean' } ], idProperty: 'MaritalStatusID' }); } //#endregion //#region "Create Reason To Resign Model" if (!Ext.ModelManager.isRegistered('reasonToResignModel')) { Ext.define("reasonToResignModel", {

extend: "Ext.data.Model", fields: [ { name: 'ReasonToResignID', type: 'int' }, { name: 'ReasonToResignName', type: 'string' } ], idProperty: 'ReasonToResignID' }); } //#endregion //#region "Create Job Title Model" if (!Ext.ModelManager.isRegistered('jobTitleModel')) { Ext.define("jobTitleModel", { extend: "Ext.data.Model", fields: [ { name: 'JobTitleID', type: 'int' }, { name: 'JobTitleName', type: 'string' } ], idProperty: 'RecId' }); } //#endregion //#region "Create Employment Status Model" if (!Ext.ModelManager.isRegistered('employmentStatusModel')) { Ext.define("employmentStatusModel", { extend: "Ext.data.Model", fields: [ { name: 'EmploymentStatusID', type: 'int' }, { name: 'EmploymentStatusName', type: 'string' }, { name: 'IsResign', type: 'bool' } ], idProperty: 'EmploymentStatusID' }); } //#endregion //#region "Create Job Level Model" if (!Ext.ModelManager.isRegistered('jobLevelModel')) { Ext.define("jobLevelModel", { extend: "Ext.data.Model", fields: [ { name: 'JobLevelID', type: 'int' }, { name: 'JobLevelName', type: 'string' }, ], idProperty: 'JobLevelID' }); } //#endregion

//#region "Create Job Grade Model" if (!Ext.ModelManager.isRegistered('jobGradeModel')) { Ext.define("jobGradeModel", { extend: "Ext.data.Model", fields: [ { name: 'JobGradeID', type: 'int' }, { name: 'JobGradeName', type: 'string' } ], idProperty: 'JobGradeID' }); } //#endregion //#region "Create Worksource Model" if (!Ext.ModelManager.isRegistered('workSourceModel')) { Ext.define("workSourceModel", { extend: "Ext.data.Model", fields: [ { name: 'WorkSourceID', type: 'int' }, { name: 'WorkSourceName', type: 'string' } ], idProperty: 'RecId' }); } //#endregion //#region "Create Currency Master AX Data Model" if (!Ext.ModelManager.isRegistered('currencyMaster_AxModel')) { Ext.regModel("currencyMaster_AxModel", { fields: [ { name: 'CURRENCYCODE', type: 'string' }, { name: 'TXT', type: 'string' }, { name: 'SYMBOL', type: 'string' }, { name: 'CURRENCYCODEISO', type: 'string' } ], idProperty: 'CURRENCYCODE' }); } //#endregion //#region "Create Address Status Model" if (!Ext.ModelManager.isRegistered('AddressStatusModel')) { Ext.define("AddressStatusModel", { extend: "Ext.data.Model", fields: [ { name: 'AddressStatusID', Status: 'int' }, { name: 'AddressStatusName', Status: 'string' }, ], idProperty: 'AddressStatusID' }); } //#endregion //#region "Create Relationship Model" if (!Ext.ModelManager.isRegistered('relationshipDataModel')) { Ext.define("relationshipDataModel", { extend: "Ext.data.Model",

fields: [ { name: { name: { name: { name: ], idProperty: }); } //#endregion } //#endregion

'RelationshipID', type: 'int' }, 'RelationshipName', type: 'string' }, 'IsRelative', type: 'bool' }, 'IsSpouse', type: 'bool' } 'RelationshipID'

//#region "Create Window Form" function CreateWindowForm() { CreateDataModel(); topEmployeeForm = CreateTopInfoPanel(); employeeInput = CreateEmployeeForm(); employeeWindow = new Ext.widget('window', { title: '', closeAction: 'hide', bodyStyle: 'padding:5px; background-color: #ffffff;', width: 990, height: 660, id: 'employeeForm', name: 'employeeForm', //layout: 'fit', animCollapse: false, resizable: false, maskOnDisable: true, modal: true, AnimateShow: function () { employeeWindow.show(); employeeWindow.animate({ from: { width: 1, height: 1, opacity: 0 }, to: { width: 990, height: 660, opacity: 1 }, duration: 1000 }); }, AnimateHide: function () { employeeWindow.animate({ from: { width: 990, height: 660, opacity: 1 }, to: { width: 1, height: 1, opacity: 0 }, duration: 1000,

listeners: { afteranimate: function (item, e) { employeeWindow.hide(); } } }); }, ValidateDataStore: function () { alert('Not Implemented Yet'); //employeeInput.ValidateDataStore(); }, ClearDataStore: function () { employeeInput.ClearDataStores(); }, items: [topEmployeeForm, employeeInput], listeners: { 'beforehide': { fn: function (obj, options) { employeeInput.getForm().reset(); Ext.getCmp('EmployeePictureImage').getEl().dom.src = '../Ima ge/EmployeePhoto/BlankPhoto.png'; SetInitialActiveTab(); } }, 'hide': { fn: function (obj, options) { global_cancelRefresh = false; } }, 'show': { fn: function (obj, options) { } }, 'move': { fn: function (obj, x, y, options) { if (_isEmployeeWindowsMoving) { _isEmployeeWindowsMoving = false; var xPos, yPos; if (x < 0) xPos = 0; else xPos = x; if (y < 0) yPos = 0; else yPos = y; employeeWindow.setPagePosition(xPos, yPos); _isEmployeeWindowsMoving = true; } }, scope: this } }, buttons: [{ text: 'Close', id: 'closeButton',

handler: function () { employeeWindow.hide(); } }, { text: 'Cancel', id: 'cancelButton', handler: function () { employeeWindow.hide(); } }, { text: 'Save', id: 'updateButton', formBind: true, //disabled: true, handler: function () { //employeeInput.ValidateDataStore() //alert(convertToJSON(employeeContactDataStore)); if (employeeInput.getForm().isValid()) { // && __IsAllDataStoreV alid) { employeeInput.getForm().submit({ url: '../handler/HRISHandler.aspx', method: 'POST', params: { opr: 1003, isPersonalDetailsTabShowed: isPersonalDetailsTabShow ed, isContactDetailsTabShowed: isContactDetailsTabShowed , isAddressesTabShowed: isAddressesTabShowed, isEmergencyAddressTabShowed: isEmergencyAddressTabSh owed, isIdentityCardsTabShowed: isIdentityCardsTabShowed, isFamilyStructuresTabShowed: isFamilyStructuresTabSh owed, isEmploymentStatusTabShowed: isEmploymentStatusTabSh owed, isResignationNoteTabShowed: isResignationNoteTabShow ed, isSMSForwardingToTabShowed: isSMSForwardingToTabShow ed, isInternalWorkingHistoryTabShowed: isInternalWorking HistoryTabShowed, isSalaryandBenefitsTabShowed: isSalaryandBenefitsTab Showed, isBankAccountandTaxInfoTabShowed: isBankAccountandTa xInfoTabShowed, isEducationalBackgroundTabShowed: isEducationalBackg roundTabShowed, isTrainingsandSeminardsTabShowed: isTrainingsandSemi nardsTabShowed, isProfesionalCertificatesTabShowed: isProfesionalCer tificatesTabShowed, isProfesionalExamTabShowed: isProfesionalExamTabShow ed, isScholarshipsTabShowed: isScholarshipsTabShowed, isExternalWorkingHistoryTabShowed: isExternalWorking HistoryTabShowed, isSocialandPoliticalActivitiesTabShowed: isSocialand PoliticalActivitiesTabShowed,

isMilitaryConscriptTabShowed: isMilitaryConscriptTab Showed, isNonScholarshipAwardsTabShowed: isNonScholarshipAwa rdsTabShowed, isLanguageAbilityTabShowed: isLanguageAbilityTabShow ed, isHobbyTabShowed: isHobbyTabShowed, isMedicalRecordsTabShowed: isMedicalRecordsTabShowed , isReferenceDetailsTabShowed: isReferenceDetailsTabSh owed, isQuestionnairesTabShowed: isQuestionnairesTabShowed , isMiscellaneousInfoTabShowed: isMiscellaneousInfoTab Showed, isEmployeeContactDataStoreLoaded: isEmployeeContactD ataStoreLoaded, isEmployeeAddressDataStoreLoaded: isEmployeeAddressD ataStoreLoaded, isEmployeeEmergencyAddressDataStoreLoaded: isEmploye eEmergencyAddressDataStoreLoaded, isEmployeeIdentificationDataStoreLoaded: isEmployeeI dentificationDataStoreLoaded, isEmployeeBankAccountDataStoreLoaded: isEmployeeBank AccountDataStoreLoaded, isEmployeeTaxAccountDataStoreLoaded: isEmployeeTaxAc countDataStoreLoaded, isEmployeeFamilyDataStoreLoaded: isEmployeeFamilyDat aStoreLoaded, isEmployeeReportingToSMSDataStoreLoaded: isEmployeeR eportingToSMSDataStoreLoaded, isEmployeeInternalWorkDataStoreLoaded: isEmployeeInt ernalWorkDataStoreLoaded, isEmployeeEducationDataStoreLoaded: isEmployeeEducat ionDataStoreLoaded, isEmployeeTrainingDataStoreLoaded: isEmployeeTrainin gDataStoreLoaded, isEmployeeCertificateDataStoreLoaded: isEmployeeCert ificateDataStoreLoaded, isEmployeeExamDataStoreLoaded: isEmployeeExamDataSto reLoaded, isEmployeeScholarshipDataStoreLoaded: isEmployeeScho larshipDataStoreLoaded, isEmployeeExternalWorkDataStoreLoaded: isEmployeeExt ernalWorkDataStoreLoaded, isEmployeeOrganizationDataStoreLoaded: isEmployeeOrg anizationDataStoreLoaded, isEmployeeMilitaryConscriptDataStoreLoaded: isEmploy eeMilitaryConscriptDataStoreLoaded, isEmployeeAwardDataStoreLoaded: isEmployeeAwardDataS toreLoaded, isEmployeeLanguageDataStoreLoaded: isEmployeeLanguag eDataStoreLoaded, isEmployeeHobbyDataStoreLoaded: isEmployeeHobbyDataS toreLoaded, isEmployeeHealthDataStoreLoaded: isEmployeeHealthDat aStoreLoaded, isEmployeeReferenceDataStoreLoaded: isEmployeeRefere nceDataStoreLoaded,

isEmployeeQuestionTaskDataStoreLoaded: isEmployeeQue stionTaskDataStoreLoaded, isEmployeeEmergencyDataStoreLoaded: isEmployeeEmerge ncyDataStoreLoaded, Id: _SelectedEmployeeRecord.Id, EmployeeNoDisplay: topEmployeeForm.getForm().findFie ld("EmployeeNoDisplay").getValue(), PictureFile: Ext.getCmp('EmployeePictureImage').getE l().dom.src, //#region "Personal Details Tab" SalutationName: employeeInput.getForm().findField("S alutationName").getValue(), FirstName: employeeInput.getForm().findField("FirstN ame").getValue(), LastName: employeeInput.getForm().findField("LastNam e").getValue(), NickName: employeeInput.getForm().findField("NickNam e").getValue(), Gender: employeeInput.getForm().findField("Gender"). getValue(), BloodTypeID: employeeInput.getForm().findField("Bloo dTypeID").getValue(), ReligionID: employeeInput.getForm().findField("Relig ionID").getValue(), Height: employeeInput.getForm().findField("Height"). getValue(), Weight: employeeInput.getForm().findField("Weight"). getValue(), BirthDate: employeeInput.getForm().findField("BirthD ate").getValue(), BirthCityID: employeeInput.getForm().findField("Birt hCityID").getValue(), EtnicID: employeeInput.getForm().findField("EtnicID" ).getValue(), NationalityCountryID: employeeInput.getForm().findFi eld("NationalityCountryID").getValue(), MaritalStatusID: employeeInput.getForm().findField(" MaritalStatusID").getValue(), MarriageDate: employeeInput.getForm().findField("Mar riageDate").getValue(), //#endregion //#region "Contact Details Tab" employeeContactDataStore: convertToJSON(employeeCont actDataStore), //#endregion //#region "Addresses Tab" employeeAddressDataStore: convertToJSON(employeeAddr essDataStore), //#endregion //#region "Emergency Address Tab" EmergencyAddress_AddressStatus: employeeInput.getFor m().findField("EmergencyAddress_AddressStatus").getValue(), EmergencyAddress_AddressName: employeeInput.getForm( ).findField("EmergencyAddress_AddressName").getValue(), EmergencyAddress_RTCode: employeeInput.getForm().fin

dField("EmergencyAddress_RTCode").getValue(), EmergencyAddress_RWCode: employeeInput.getForm().fin dField("EmergencyAddress_RWCode").getValue(), EmergencyAddress_KelurahanName: employeeInput.getFor m().findField("EmergencyAddress_KelurahanName").getValue(), EmergencyAddress_KecamatanName: employeeInput.getFor m().findField("EmergencyAddress_KecamatanName").getValue(), EmergencyAddress_CityID: employeeInput.getForm().fin dField("EmergencyAddress_CityID").getValue(), EmergencyAddress_PostalCode: employeeInput.getForm() .findField("EmergencyAddress_PostalCode").getValue(), EmergencyAddress_FaxNumber: employeeInput.getForm(). findField("EmergencyAddress_FaxNumber").getValue(), EmergencyAddress_FirstName: employeeInput.getForm(). findField("EmergencyAddress_FirstName").getValue(), EmergencyAddress_LastName: employeeInput.getForm().f indField("EmergencyAddress_LastName").getValue(), EmergencyAddress_RelationshipId: employeeInput.getFo rm().findField("EmergencyAddress_RelationshipId").getValue(), EmergencyAddress_Gender: employeeInput.getForm().fin dField("EmergencyAddress_Gender").getValue(), EmergencyAddress_ContactNo: employeeInput.getForm(). findField("EmergencyAddress_ContactNo").getValue(), //#endregion //#region "Identity Cards Tab" employeeIdentificationDataStore: convertToJSON(emplo yeeIdentificationDataStore), //#endregion //#region "Family Structures Tab" employeeFamilyDataStore: convertToJSON(employeeFamil yDataStore), //#endregion //#region "Employment Status Tab" JobTitleID: employeeInput.getForm().findField("JobTi tleID").getValue(), JobTitlePublish: employeeInput.getForm().findField(" JobTitlePublish").getValue(), DepartmentID: employeeInput.getForm().findField("Dep artmentID").getValue(), OfficeLocationID: employeeInput.getForm().findField( "OfficeLocationID").getValue(), EmploymentStatusID: employeeInput.getForm().findFiel d("EmploymentStatusID").getValue(), JobLevelID: employeeInput.getForm().findField("JobLe velID").getValue(), JobGradeID: employeeInput.getForm().findField("JobGr adeID").getValue(), JoinDate: employeeInput.getForm().findField("JoinDat e").getValue(), ReportingTo: employeeInput.getForm().findField("Repo rtingTo").getValue(), ActiveDirectory: employeeInput.getForm().findField(" ActiveDirectory").getValue(), //#endregion

//#region "Resignation Note Tab" ResignDate: employeeInput.getForm().findField("Resig nDate").getValue(), ReasonToResignID: employeeInput.getForm().findField( "ReasonToResignID").getValue(), //#endregion //#region "SMS Forwarding To Tab" employeeReportingToSMSDataStore: convertToJSON(emplo yeeReportingToSMSDataStore), //#endregion //#region "Internal Working History Tab" employeeInternalWorkDataStore: convertToJSON(employe eInternalWorkDataStore), //#endregion employeeEmergencyAddressDataStore: convertToJSON(emp loyeeEmergencyAddressDataStore), employeeEmergencyDataStore: convertToJSON(employeeEm ergencyDataStore), //#region "Salary and Benefits Tab" LastMainSalaryAmount: employeeInput.getForm().findFi eld("LastMainSalaryAmount").getValue(), LastAnnualBonusAmount: employeeInput.getForm().findF ield("LastAnnualBonusAmount").getValue(), LastPerformanceBonusAmount: employeeInput.getForm(). findField("LastPerformanceBonusAmount").getValue(), LastBenefitsAmount: employeeInput.getForm().findFiel d("LastBenefitsAmount").getValue(), ExpectedSalaryAmount: employeeInput.getForm().findFi eld("ExpectedSalaryAmount").getValue(), LastMainSalaryCurrency: employeeInput.getForm().find Field("LastMainSalaryCurrency").getValue(), LastAnnualBonusCurrency: employeeInput.getForm().fin dField("LastAnnualBonusCurrency").getValue(), LastPerformanceBonusCurrency: employeeInput.getForm( ).findField("LastPerformanceBonusCurrency").getValue(), LastBenefitsCurrency: employeeInput.getForm().findFi eld("LastBenefitsCurrency").getValue(), ExpectedSalaryCurrency: employeeInput.getForm().find Field("ExpectedSalaryCurrency").getValue(), NoticePeriod: employeeInput.getForm().findField("Not icePeriod").getValue(), //#endregion //#region "Bank Account and Tax Info Tab" BankAccount_IdentificationNo: employeeInput.getForm( ).findField("BankAccount_IdentificationNo").getValue(), BankAccount_CityId: employeeInput.getForm().findFiel d("BankAccount_CityId").getValue(), TaxAccount_IdentificationNo: employeeInput.getForm() .findField("TaxAccount_IdentificationNo").getValue(), TaxAccount_CityId: employeeInput.getForm().findField ("TaxAccount_CityId").getValue(), //#endregion //#region "Bank Account and Tax Info Tab"

//BCAAccount //CityBCAAccount //TaxAccount //CityTaxAccount //#endregion //#region "Educational Background Tab" employeeEducationDataStore: convertToJSON(employeeEd ucationDataStore), //#endregion //#region "Trainings and Seminars Tab" employeeTrainingDataStore: convertToJSON(employeeTra iningDataStore), //#endregion //#region "Profesional Certificates Tab" employeeCertificateDataStore: convertToJSON(employee CertificateDataStore), //#endregion //#region "Profesional Exam Tab" employeeExamDataStore: convertToJSON(employeeExamDat aStore), //#endregion //#region "Scholarships Tab" employeeScholarshipDataStore: convertToJSON(employee ScholarshipDataStore), //#endregion //#region "External Working History Tab" employeeExternalWorkDataStore: convertToJSON(employe eExternalWorkDataStore), //#endregion //#region "Social and Political Activities Tab" employeeOrganizationDataStore: convertToJSON(employe eOrganizationDataStore), //#endregion //#region "Military Conscript Tab" employeeMilitaryConscriptDataStore: convertToJSON(em ployeeMilitaryConscriptDataStore), //#endregion //#region "Non-Scholarship Awards Tab" employeeAwardDataStore: convertToJSON(employeeAwardD ataStore), //#endregion //#region "Language Ability Tab" employeeLanguageDataStore: convertToJSON(employeeLan guageDataStore), //#endregion //#region "Hobby Tab" employeeHobbyDataStore: convertToJSON(employeeHobbyD ataStore), //#endregion

//#region "Medical Records Tab" employeeHealthDataStore: convertToJSON(employeeHealt hDataStore), //#endregion //#region "Reference Details Tab" employeeReferenceDataStore: convertToJSON(employeeRe ferenceDataStore), //#endregion //#region "Questionnaires Tab" employeeQuestionTaskDataStore: convertToJSON(employe eQuestionTaskDataStore), //#endregion //#region "Miscellaneous Info Tab" IsWillingToTravel: employeeInput.getForm().findField ("IsWillingToTravel").getValue(), IsWillingToRelocated: employeeInput.getForm().findFi eld("IsWillingToRelocated").getValue(), WorkSourceID: employeeInput.getForm().findField("Wor kSourceID").getValue(), ReasonToJoin: employeeInput.getForm().findField("Rea sonToJoin").getValue(), OtherConsideration: employeeInput.getForm().findFiel d("OtherConsideration").getValue(), CareerObjectives: employeeInput.getForm().findField( "CareerObjectives").getValue() //#endregion }, submitEmptyText: true, timeout: 300, waitMsg: 'Saving Data...', success: function (form, action) { employeeDataStore.load(); employeeWindow.hide(); }, failure: function (form, action) { if (action.failureType === Ext.form.Action.CONNECT_F AILURE) { Ext.Msg.alert('Failure', 'Server reported:' + ac tion.response.status + ' ' + action.response.statusText); } if (action.failureType === Ext.form.Action.SERVER_IN VALID) { Ext.Msg.alert('Warning', action.result.errormsg) ; } employeeDataStore.load(); employeeWindow.hide(); } }); } else { ShowMessageDialog("All Mandatories Fields Required"); } } }, { text: 'Save', id: 'addButton',

formBind: true, //disabled: true, handler: function () { //employeeInput.ValidateDataStore() //alert(convertToJSON(employeeContactDataStore)); if (employeeInput.getForm().isValid()) { // && __IsAllDataStoreV alid) { employeeInput.getForm().submit({ url: '../handler/HRISHandler.aspx', method: 'POST', params: { opr: 1002, EmployeeNoDisplay: topEmployeeForm.getForm().findFie ld("EmployeeNoDisplay").getValue(), PictureFile: Ext.getCmp('EmployeePictureImage').getE l().dom.src, //#region "Personal Details Tab" SalutationName: employeeInput.getForm().findField("S alutationName").getValue(), FirstName: employeeInput.getForm().findField("FirstN ame").getValue(), LastName: employeeInput.getForm().findField("LastNam e").getValue(), NickName: employeeInput.getForm().findField("NickNam e").getValue(), Gender: employeeInput.getForm().findField("Gender"). getValue(), BloodTypeID: employeeInput.getForm().findField("Bloo dTypeID").getValue(), ReligionID: employeeInput.getForm().findField("Relig ionID").getValue(), Height: employeeInput.getForm().findField("Height"). getValue(), Weight: employeeInput.getForm().findField("Weight"). getValue(), BirthDate: employeeInput.getForm().findField("BirthD ate").getValue(), BirthCityID: employeeInput.getForm().findField("Birt hCityID").getValue(), EtnicID: employeeInput.getForm().findField("EtnicID" ).getValue(), NationalityCountryID: employeeInput.getForm().findFi eld("NationalityCountryID").getValue(), MaritalStatusID: employeeInput.getForm().findField(" MaritalStatusID").getValue(), MarriageDate: employeeInput.getForm().findField("Mar riageDate").getValue(), //#endregion //#region "Contact Details Tab" employeeContactDataStore: convertToJSON(employeeCont actDataStore), //#endregion //#region "Addresses Tab" employeeAddressDataStore: convertToJSON(employeeAddr essDataStore), //#endregion

//#region "Emergency Address Tab" EmergencyAddress_AddressStatus: employeeInput.getFor m().findField("EmergencyAddress_AddressStatus").getValue(), EmergencyAddress_AddressName: employeeInput.getForm( ).findField("EmergencyAddress_AddressName").getValue(), EmergencyAddress_RTCode: employeeInput.getForm().fin dField("EmergencyAddress_RTCode").getValue(), EmergencyAddress_RWCode: employeeInput.getForm().fin dField("EmergencyAddress_RWCode").getValue(), EmergencyAddress_KelurahanName: employeeInput.getFor m().findField("EmergencyAddress_KelurahanName").getValue(), EmergencyAddress_KecamatanName: employeeInput.getFor m().findField("EmergencyAddress_KecamatanName").getValue(), EmergencyAddress_CityID: employeeInput.getForm().fin dField("EmergencyAddress_CityID").getValue(), EmergencyAddress_PostalCode: employeeInput.getForm() .findField("EmergencyAddress_PostalCode").getValue(), EmergencyAddress_FaxNumber: employeeInput.getForm(). findField("EmergencyAddress_FaxNumber").getValue(), EmergencyAddress_FirstName: employeeInput.getForm(). findField("EmergencyAddress_FirstName").getValue(), EmergencyAddress_LastName: employeeInput.getForm().f indField("EmergencyAddress_LastName").getValue(), EmergencyAddress_RelationshipId: employeeInput.getFo rm().findField("EmergencyAddress_RelationshipId").getValue(), EmergencyAddress_Gender: employeeInput.getForm().fin dField("EmergencyAddress_Gender").getValue(), EmergencyAddress_ContactNo: employeeInput.getForm(). findField("EmergencyAddress_ContactNo").getValue(), //#endregion //#region "Identity Cards Tab" employeeIdentificationDataStore: convertToJSON(emplo yeeIdentificationDataStore), //#endregion //#region "Family Structures Tab" employeeFamilyDataStore: convertToJSON(employeeFamil yDataStore), //#endregion //#region "Employment Status Tab" JobTitleID: employeeInput.getForm().findField("JobTi tleID").getValue(), JobTitlePublish: employeeInput.getForm().findField(" JobTitlePublish").getValue(), DepartmentID: employeeInput.getForm().findField("Dep artmentID").getValue(), OfficeLocationID: employeeInput.getForm().findField( "OfficeLocationID").getValue(), EmploymentStatusID: employeeInput.getForm().findFiel d("EmploymentStatusID").getValue(), JobLevelID: employeeInput.getForm().findField("JobLe velID").getValue(), JobGradeID: employeeInput.getForm().findField("JobGr adeID").getValue(), JoinDate: employeeInput.getForm().findField("JoinDat e").getValue(),

ReportingTo: employeeInput.getForm().findField("Repo rtingTo").getValue(), ActiveDirectory: employeeInput.getForm().findField(" ActiveDirectory").getValue(), //#endregion //#region "Resignation Note Tab" ResignDate: employeeInput.getForm().findField("Resig nDate").getValue(), ReasonToResignID: employeeInput.getForm().findField( "ReasonToResignID").getValue(), //#endregion //#region "SMS Forwarding To Tab" employeeReportingToSMSDataStore: convertToJSON(emplo yeeReportingToSMSDataStore), //#endregion //#region "Internal Working History Tab" employeeInternalWorkDataStore: convertToJSON(employe eInternalWorkDataStore), //#endregion //#region "Salary and Benefits Tab" LastMainSalaryAmount: employeeInput.getForm().findFi eld("LastMainSalaryAmount").getValue(), LastAnnualBonusAmount: employeeInput.getForm().findF ield("LastAnnualBonusAmount").getValue(), LastPerformanceBonusAmount: employeeInput.getForm(). findField("LastPerformanceBonusAmount").getValue(), LastBenefitsAmount: employeeInput.getForm().findFiel d("LastBenefitsAmount").getValue(), ExpectedSalaryAmount: employeeInput.getForm().findFi eld("ExpectedSalaryAmount").getValue(), LastMainSalaryCurrency: employeeInput.getForm().find Field("LastMainSalaryCurrency").getValue(), LastAnnualBonusCurrency: employeeInput.getForm().fin dField("LastAnnualBonusCurrency").getValue(), LastPerformanceBonusCurrency: employeeInput.getForm( ).findField("LastPerformanceBonusCurrency").getValue(), LastBenefitsCurrency: employeeInput.getForm().findFi eld("LastBenefitsCurrency").getValue(), ExpectedSalaryCurrency: employeeInput.getForm().find Field("ExpectedSalaryCurrency").getValue(), NoticePeriod: employeeInput.getForm().findField("Not icePeriod").getValue(), //#endregion //#region "Bank Account and Tax Info Tab" BankAccount_IdentificationNo: employeeInput.getForm( ).findField("BankAccount_IdentificationNo").getValue(), BankAccount_CityId: employeeInput.getForm().findFiel d("BankAccount_CityId").getValue(), TaxAccount_IdentificationNo: employeeInput.getForm() .findField("TaxAccount_IdentificationNo").getValue(), TaxAccount_CityId: employeeInput.getForm().findField ("TaxAccount_CityId").getValue(), //#endregion //#region "Educational Background Tab"

employeeEducationDataStore: convertToJSON(employeeEd ucationDataStore), //#endregion //#region "Trainings and Seminars Tab" employeeTrainingDataStore: convertToJSON(employeeTra iningDataStore), //#endregion //#region "Profesional Certificates Tab" employeeCertificateDataStore: convertToJSON(employee CertificateDataStore), //#endregion //#region "Profesional Exam Tab" employeeExamDataStore: convertToJSON(employeeExamDat aStore), //#endregion //#region "Scholarships Tab" employeeScholarshipDataStore: convertToJSON(employee ScholarshipDataStore), //#endregion //#region "External Working History Tab" employeeExternalWorkDataStore: convertToJSON(employe eExternalWorkDataStore), //#endregion //#region "Social and Political Activities Tab" employeeOrganizationDataStore: convertToJSON(employe eOrganizationDataStore), //#endregion //#region "Military Conscript Tab" employeeMilitaryConscriptDataStore: convertToJSON(em ployeeMilitaryConscriptDataStore), //#endregion //#region "Non-Scholarship Awards Tab" employeeAwardDataStore: convertToJSON(employeeAwardD ataStore), //#endregion //#region "Language Ability Tab" employeeLanguageDataStore: convertToJSON(employeeLan guageDataStore), //#endregion //#region "Hobby Tab" employeeHobbyDataStore: convertToJSON(employeeHobbyD ataStore), //#endregion //#region "Medical Records Tab" employeeHealthDataStore: convertToJSON(employeeHealt hDataStore), //#endregion //#region "Reference Details Tab"

employeeReferenceDataStore: convertToJSON(employeeRe ferenceDataStore), //#endregion //#region "Questionnaires Tab" employeeQuestionTaskDataStore: convertToJSON(employe eQuestionTaskDataStore), //#endregion //#region "Miscellaneous Info Tab" IsWillingToTravel: employeeInput.getForm().findField ("IsWillingToTravel").getValue(), IsWillingToRelocated: employeeInput.getForm().findFi eld("IsWillingToRelocated").getValue(), WorkSourceID: employeeInput.getForm().findField("Wor kSourceID").getValue(), ReasonToJoin: employeeInput.getForm().findField("Rea sonToJoin").getValue(), OtherConsideration: employeeInput.getForm().findFiel d("OtherConsideration").getValue(), CareerObjectives: employeeInput.getForm().findField( "CareerObjectives").getValue() //#endregion }, submitEmptyText: false, waitMsg: 'Saving Data...', success: function (form, action) { employeeDataStore.load(); employeeWindow.hide(); }, failure: function (form, action) { employeeWindow.close(); if (action.failureType === Ext.form.Action.CONNECT_F AILURE) { Ext.Msg.alert('Failure', 'Server reported:' + ac tion.response.status + ' ' + action.response.statusText); } if (action.failureType === Ext.form.Action.SERVER_IN VALID) { Ext.Msg.alert('Warning', action.result.errormsg) ; } employeeDataStore.load(); employeeWindow.hide(); } }); } else { ShowMessageDialog("All Mandatories Fields Required"); } } }] }); } //#endregion //#region "Create Employee Address Grid" function CreateEmployeeAddressGrid(dataStore) { //#region "Create BBar" var employeeAddressGridBBar = new Ext.Toolbar({

id: 'employeeAddressGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeAddressForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeAddressForm(dataStore, selectedEmployeeAdd ressRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeAddressDialog(dataStore, selectedEmployeeA ddressRecord); } }] }); //#endregion //#region "Create Employee Address Column Grid" employeeAddressColumns = [ { dataIndex: 'AddressTypeName', id: 'EmployeeAddress_AddressTypeName', text: "Type", width: 110//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'AddressTypeID', id: 'EmployeeAddress_AddressTypeID', hidden: true, hideable: false //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'AddressName', id: 'EmployeeAddress_AddressName', text: "Address", width: 200//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'RTCode',

id: 'EmployeeAddress_RTCode', text: "RT", width: 80//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'RWCode', id: 'EmployeeAddress_RWCode', text: "RW", width: 80//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'KelurahanName', id: 'EmployeeAddress_KelurahanName', text: "Kelurahan", width: 100//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'KecamatanName', id: 'EmployeeAddress_KecamatanName', text: "Kecamatan", width: 100//, //sortable: true // filter: { type: 'string' } }, { dataIndex: 'CityID', id: 'EmployeeAddress_CityID', hidden: true, hideable: false //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'CityName', id: 'EmployeeAddress_CityName', text: "City", width: 130//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'ProvinceStateName', id: 'EmployeeAddress_ProvinceStateName', text: "Province/State", width: 130//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'CountryName',

id: 'EmployeeAddress_CountryName', text: "Country", width: 130//, //sortable: true //filterable: true, // filter: { type: 'string' } },{ dataIndex: 'PostalCode', id: 'EmployeeAddress_PostalCode', text: "Postal Code", width: 100//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'FaxNumber', id: 'EmployeeAddress_FaxNumber', text: "Fax", width: 110//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'AddressStatusName', id: 'EmployeeAddress_AddressStatusName', text: "Status", width: 110//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'AddressStatusID', id: 'EmployeeAddress_AddressStatusID', hidden: true, hideable: false //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'AddressContact', id: 'EmployeeAddress_AddressContact', text: "Phone Number(s)", width: 300//, //sortable: true //filterable: true, // filter: { type: 'string' } } ]; //#endregion //#region "Create Employee Address Grid" employeeAddressGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore,

id: 'employeeAddressGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeAddressRecord = record; ShowUpdateEmployeeAddressForm(dataStore, selectedEmployeeAddre ssRecord); } }, // grid columns: employeeAddressColumns, tbar: employeeAddressGridBBar }) //#endregion employeeAddressGrid.on('itemclick', function (obj, record, item, index, e, o ptions) { selectedEmployeeAddressRecord = record; }); //#region "Attach Context Menu to Grid" employeeAddressGrid.on('itemcontextmenu', function (obj, record, item, index , e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeAddressGrid'; selectedEmployeeAddressRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeAddressGrid; } //#endregion //#region "Create Employee Contact Grid" function CreateEmployeeContactGrid(dataStore) { //#region "Create BBar" var employeeContactGridBBar = new Ext.Toolbar({ id: 'employeeContactGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeContactForm(dataStore) }

}, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeContactForm(dataStore, selectedEmployeeCon tactRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeContactDialog(dataStore, selectedEmployeeC ontactRecord); } }] }); //#endregion //#region "Create Employee Contact Columns Grid" employeeContactColumns = [ { dataIndex: 'ContactTypeName', id: 'EmployeeAddress_ContactTypeName', text: "Type", flex: 0.4//, //sortable: true }, { dataIndex: 'ContactTypeID', id: 'EmployeeAddress_ContactTypeID', hidden: true, hideable: false //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'ContactNo', id: 'EmployeeAddress_ContactNo', text: "Contact", flex: 0.4//, //sortable: true }, { dataIndex: 'IsSMSReport', id: 'EmployeeAddress_IsSMSReport', text: "Is SMS Gateway", flex: 0.2, align: 'center', renderer: function IsSMSReport(val, x, store) { if (!val) return ''; else return 'V'; } } ]; //#endregion //#region "Create Employee Contact Grid" employeeContactGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false,

enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeContactGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeContactRecord = record; ShowUpdateEmployeeContactForm(dataStore, selectedEmployeeConta ctRecord); } }, // grid columns: employeeContactColumns, tbar: employeeContactGridBBar }) //#endregion employeeContactGrid.on('itemclick', function (obj, record, item, index, e, o ptions) { selectedEmployeeContactRecord = record; }); //#region "Attach Context Menu to Grid" employeeContactGrid.on('itemcontextmenu', function (obj, record, item, index , e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeContactGrid'; selectedEmployeeContactRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeContactGrid; } //#endregion //#region "Create Employee Identification Grid" function CreateEmployeeIdentificationGrid(dataStore) { //#region "Create BBar" var employeeIdentificationGridBBar = new Ext.Toolbar({ id: 'employeeIdentificationGridBBar', items: [{ iconCls: 'grid-add-icon',

text: 'Add', scope: this, handler: function () { ShowInsertEmployeeIdentificationForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeIdentificationForm(dataStore, selectedEmpl oyeeIdentificationRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeIdentificationDialog(dataStore, selectedEm ployeeIdentificationRecord); } }] }); //#endregion //#region "Create Employee Contact Columns Grid" employeeIdentificationColumns = [ { dataIndex: 'IdentificationTypeName', id: 'EmployeeIdentification_IdentificationTypeName', text: "Type", width: 120//, //sortable: true // filter: { type: 'string' } }, { dataIndex: 'IdentificationTypeID', id: 'EmployeeIdentification_IdentificationTypeID', hidden: true, hideable: false //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'CityName', id: 'EmployeeIdentification_CityName', text: "City", width: 120//, //sortable: true //filterable: true, // filter: { type: 'string' } }, {

dataIndex: 'CityID', id: 'EmployeeIdentification_CityID', hidden: true, hideable: false //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'ProvinceStateName', id: 'EmployeeIdentification_ProvinceStateName', text: "Country", width: 120//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'IdentificationNo', id: 'EmployeeIdentification_IdentificationNo', text: "Identification No", flex: 1/*, sortable: true, filterable: true, filter: { type: 'string' }*/ }, { dataIndex: 'StartDate', id: 'EmployeeIdentification_StartDate', text: "Valid Date", width: 90, //sortable: true, format: 'd/m/Y', //filterable: true, renderer: Ext.util.Format.dateRenderer('d/m/Y')//, //filter: { type: 'date' } }, { dataIndex: 'ExpiredDate', id: 'EmployeeIdentification_ExpiredDate', text: "Expired Date", width: 90, //sortable: true, format: 'd/m/Y', //filterable: true, renderer: Ext.util.Format.dateRenderer('d/m/Y')//, //filter: { type: 'date' } } ]; //#endregion //#region "Create Employee Contact Grid" employeeIdentificationGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'gridEmployeeIdentification', width: '100%', height: '100%', disableSelection: false,

loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeIdentificationRecord = record; ShowUpdateEmployeeIdentificationForm(dataStore, selectedEmployee IdentificationRecord); } }, // grid columns: employeeIdentificationColumns, tbar: employeeIdentificationGridBBar }) //#endregion employeeIdentificationGrid.on('itemclick', function (obj, record, item, inde x, e, options) { selectedEmployeeIdentificationRecord = record; }); //#region "Attach Context Menu to Grid" employeeIdentificationGrid.on('itemcontextmenu', function (obj, record, item , index, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeIdentificationGrid'; selectedEmployeeIdentificationRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeIdentificationGrid; } //#endregion //#region "Create Employee Family Grid" function CreateEmployeeFamilyGrid(dataStore) { //#region "Create BBar" var employeeNextOfKinGridBBar = new Ext.Toolbar({ id: 'employeeNextOfKinGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeNextOfKinForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update',

scope: this, handler: function () { ShowUpdateEmployeeNextOfKinForm(dataStore, selectedEmployeeN extOfKinRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeNextOfKinDialog(dataStore, selectedEmploye eNextOfKinRecord); } }] }); //#endregion //#region "Create Employee Contact Columns Grid" employeeFamilyColumns = [ { dataIndex: 'RelationshipName', id: 'EmployeeFamily_RelationshipName', text: "Relationship" }, { dataIndex: 'RelationshipID', id: 'EmployeeFamily_RelationshipID', hidden: true, hideable: false //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'FirstName', id: 'EmployeeFamily_FirstName', text: "First Name" }, { dataIndex: 'LastName', id: 'EmployeeFamily_LastName', text: "Last Name" }, { dataIndex: 'isPPHfactor', id: 'EmployeeFamily_isPPHfactor', text: "is PPH factor", align: 'center', renderer: function isPPHfactor(val, x, store) { if (!val) return ''; else return 'V'; } }, { dataIndex: 'Gender', id: 'EmployeeFamily_Gender', text: "Gender", renderer: function gender(val, x, store) { if (!val) return 'Female' ; else return 'Male'; } },

{ dataIndex: 'BirthDate', id: 'EmployeeFamily_BirthDate', text: "Birth Date", //width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y')//, //filter: { type: 'date' } }, { dataIndex: 'BirthCityName', id: 'EmployeeFamily_BirthCityName', text: "Birth City"//, //width: 150 }, { dataIndex: 'BirthCityID', id: 'EmployeeFamily_BirthCityID', hidden: true, hideable: false //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'BirthCountryName', id: 'EmployeeFamily_BirthCountryName', text: "Country"//, //width: 150 }, { dataIndex: 'EducationTypeName', id: 'EmployeeFamily_EducationTypeName', text: "Education"//, //width: 120//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'EducationTypeID', id: 'EmployeeFamily_EducationTypeID', hidden: true, hideable: false //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'LineOfBusinessName', id: 'EmployeeFamily_LineOfBusinessName', text: "Line Of Business"//, //width: 120//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'LineOfBusinessID',

id: 'EmployeeFamily_LineOfBusinessID', hidden: true, hideable: false //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'WorkAtCompanyName', id: 'EmployeeFamily_WorkAtCompanyName', text: "Company Name"//, //width: 150//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'LastJob', id: 'EmployeeFamily_LastJob', text: "Job Title"//, //width: 120//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'NationalityName', id: 'EmployeeFamily_NationalityName', text: "Nationality"//, //width: 100//, //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'NationalityID', id: 'EmployeeFamily_NationalityID', hidden: true, hideable: false //sortable: true //filterable: true, // filter: { type: 'string' } }, { dataIndex: 'IsDeceased', id: 'EmployeeFamily_IsDeceased', text: "Is Deceased", align: 'center', renderer: function IsDeceased(val, x, store) { if (!val) return ''; else return 'V'; } } ]; //#endregion //#region "Create Employee Contact Grid" employeeFamilyGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false,

sortableColumns: true, store: dataStore, id: 'employeeFamilyGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeNextOfKinRecord = record; ShowUpdateEmployeeNextOfKinForm(dataStore, selectedEmployeeNext OfKinRecord); } }, // grid columns: employeeFamilyColumns, tbar: employeeNextOfKinGridBBar }) //#endregion employeeFamilyGrid.on('itemclick', function (obj, record, item, index, e, op tions) { selectedEmployeeNextOfKinRecord = record; }); //#region "Attach Context Menu to Grid" employeeFamilyGrid.on('itemcontextmenu', function (obj, record, item, index, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeFamilyGrid'; selectedEmployeeNextOfKinRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeFamilyGrid; } //#endregion //#region "Create Employee Reporting To SMS Grid" function CreateEmployeeReportingToSMSGrid(dataStore) { //#region "Create BBar" var employeeReportingToSMSGridBBar = new Ext.Toolbar({ id: 'employeeReportingToSMSGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add',

scope: this, handler: function () { ShowInsertEmployeeReportingToSMSForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeReportingToSMSForm(dataStore, selectedEmpl oyeeReportingToSMSRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeReportingToSMSDialog(dataStore, selectedEm ployeeReportingToSMSRecord); } }] }); //#endregion //#region "Create Employee Contact Columns Grid" employeeReportingToSMSColumns = [ { dataIndex: 'ReportingToEmployeeNo', id: 'EmployeeReportingToSMS_ReportingToEmployeeNo', hidden: true, hideable: false //sortable: true //filterable: true, // filter: { type: 'string' } },{ dataIndex: 'ReportingToName', id: 'EmployeeReportingToSMS_ReportingToName', text: "Name", flex: 1 } ]; //#endregion //#region "Create Employee Contact Grid" employeeReportingToSMSGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeReportingToSMSGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true,

columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeReportingToSMSRecord = record; ShowUpdateEmployeeReportingToSMSForm(dataStore, selectedEmplo yeeReportingToSMSRecord); } }, // grid columns: employeeReportingToSMSColumns, tbar: employeeReportingToSMSGridBBar }) //#endregion employeeReportingToSMSGrid.on('itemclick', function (obj, record, item, inde x, e, options) { selectedEmployeeReportingToSMSRecord = record; }); //#region "Attach Context Menu to Grid" employeeReportingToSMSGrid.on('itemcontextmenu', function (obj, record, item , index, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeReportingToSMSGrid'; selectedEmployeeReportingToSMSRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeReportingToSMSGrid; } //#endregion //#region "Create Employee InternalWork Grid" function CreateEmployeeInternalWorkGrid(dataStore) { //#region "Create BBar" var employeeInternalWorkGridBBar = new Ext.Toolbar({ id: 'employeeInternalWorkGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeInternalWorkForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () {

ShowUpdateEmployeeInternalWorkForm(dataStore, selectedEmploy eeInternalWorkRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeInternalWorkDialog(dataStore, selectedEmpl oyeeInternalWorkRecord); } }] }); //#endregion //#region "Create Employee Contact Columns Grid" employeeInternalWorkColumns = [ { dataIndex: 'StartDate', id: 'EmployeeInternalWork_StartDate', text: "Start Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'EndDate', id: 'EmployeeInternalWork_EndDate', text: "End Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'EmploymentTransferName', id: 'EmployeeInternalWork_EmploymentTransferName', text: "Reposition", width: 130 }, { dataIndex: 'JobTitleName', id: 'EmployeeInternalWork_JobTitleName', text: "Job Title", width: 120 }, { dataIndex: 'JobTitlePublish', id: 'EmployeeInternalWork_JobTitlePublish', text: "Job Title Publish", width: 120 }, { dataIndex: 'JobTitleID', id: 'EmployeeInternalWork_JobTitleID', hidden: true, hideable: false }, { dataIndex: 'EmploymentStatusName',

id: 'EmployeeInternalWork_EmploymentStatusName', text: "Employment Status", width: 100 }, { dataIndex: 'EmploymentStatusID', id: 'EmployeeInternalWork_EmploymentStatusID', hidden: true, hideable: false }, { dataIndex: 'DepartmentName', id: 'EmployeeInternalWork_DepartmentName', text: "Department" }, { dataIndex: 'DivisionName', id: 'EmployeeInternalWork_DivisionName', text: "Division" }, { dataIndex: 'GroupName', id: 'EmployeeInternalWork_GroupName', text: "Group" }, { dataIndex: 'DepartmentID', id: 'EmployeeInternalWork_DepartmentID', hidden: true, hideable: false }, { dataIndex: 'OfficeLocationID', id: 'EmployeeInternalWork_OfficeLocationID', hidden: true, hideable: false }, { dataIndex: 'OfficeLocationName', id: 'EmployeeInternalWork_OfficeLocationName', text: "Office" }, { dataIndex: 'ReportingToName', id: 'EmployeeInternalWork_ReportingToName', text: "Supervisor" },{ dataIndex: 'ReportingTo', id: 'EmployeeInternalWork_ReportingTo', hidden: true, hideable: false } ]; //#endregion //#region "Create Employee Contact Grid" employeeInternalWorkGrid = Ext.create('Ext.grid.Panel', {

enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeInternalWorkGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeInternalWorkRecord = record; ShowUpdateEmployeeInternalWorkForm(dataStore, selectedEmployee InternalWorkRecord); } }, // grid columns: employeeInternalWorkColumns, tbar: employeeInternalWorkGridBBar }) //#endregion employeeInternalWorkGrid.on('itemclick', function (obj, record, item, index, e, options) { selectedEmployeeInternalWorkRecord = record; }); //#region "Attach Context Menu to Grid" employeeInternalWorkGrid.on('itemcontextmenu', function (obj, record, item, index, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeInternalWorkGrid'; selectedEmployeeInternalWorkRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeInternalWorkGrid; } //#endregion //#region "Create Employee Education Grid" function CreateEmployeeEducationGrid(dataStore) { //#region "Create BBar" var employeeEducationGridBBar = new Ext.Toolbar({

id: 'employeeEducationGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeEducationForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeEducationForm(dataStore, selectedEmployeeE ducationRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeEducationDialog(dataStore, selectedEmploye eEducationRecord); } }] }); //#endregion //#region "Create Employee Education Columns Grid" employeeEducationColumns = [ { dataIndex: 'EducationTypeName', id: 'EmployeeEducation_EducationTypeName', text: "Type", width: 120 }, { dataIndex: 'EducationDegreeName', id: 'EmployeeEducation_EducationDegreeName', text: "Degree", width: 90 },{ dataIndex: 'StartDate', id: 'EmployeeEducation_StartDate', text: "Start Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'EndDate', id: 'EmployeeEducation_EndDate', text: "End Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'EducationInstitutionName', id: 'EmployeeEducation_EducationInstitutionName',

text: "School/Institution", width: 120 }, { dataIndex: 'CityName', id: 'EmployeeEducation_CityName', text: "City", width: 100 }, { dataIndex: 'CityID', id: 'EmployeeEducation_CityID', hidden: true, hideable: false }, { dataIndex: 'CountryName', id: 'EmployeeEducation_CountryName', text: "Country", width: 100 }, { dataIndex: 'FacultyName', id: 'EmployeeEducation_FacultyName', text: "Faculty", width: 100 }, { dataIndex: 'MajorName', id: 'EmployeeEducation_MajorName', text: "Major", width: 120 }, { dataIndex: 'Grade', id: 'EmployeeEducation_Grade', text: "Grade", width: 120 }, { dataIndex: 'EducationTitle', id: 'EmployeeEducation_EducationTitle', text: "Education Title", width: 100 }, { dataIndex: 'IsGraduated', id: 'EmployeeEducation_IsGraduated', text: "Is Graduated", width: 120, align: 'center', renderer: function IsGraduated(val, x, store) { if (!val) return ''; else return 'V'; } }, { dataIndex: 'IsDropOut', id: 'EmployeeEducation_IsDropOut', text: "Is Drop Out", width: 120, align: 'center', renderer: function IsDropOut(val, x, store) { if (!val) return ''; e lse return 'V'; } } ];

//#endregion //#region "Create Employee Education Grid" employeeEducationGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeEducationGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeEducationRecord = record; ShowUpdateEmployeeEducationForm(dataStore, selectedEmployeeEduc ationRecord); } }, // grid columns: employeeEducationColumns, tbar: employeeEducationGridBBar }) //#endregion employeeEducationGrid.on('itemclick', function (obj, record, item, index, e, options) { selectedEmployeeEducationRecord = record; }); //#region "Attach Context Menu to Grid" employeeEducationGrid.on('itemcontextmenu', function (obj, record, item, ind ex, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeEducationGrid'; selectedEmployeeEducationRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeEducationGrid; } //#endregion //#region "Create Employee Training Grid" function CreateEmployeeTrainingGrid(dataStore) { //#region "Create BBar"

var employeeTrainingGridBBar = new Ext.Toolbar({ id: 'employeeTrainingGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeTrainingForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeTrainingForm(dataStore, selectedEmployeeTr ainingRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeTrainingDialog(dataStore, selectedEmployee TrainingRecord); } }] }); //#endregion //#region "Create Employee Training Columns Grid" employeeTrainingColumns = [ { dataIndex: 'TrainingName', id: 'EmployeeTraining_TrainingName', text: "Name", width: 120 }, { dataIndex: 'TrainingTypeName', id: 'EmployeeTraining_TrainingTypeName', text: "Type", width: 120 }, { dataIndex: 'TrainingTypeID', id: 'EmployeeTraining_TrainingTypeID', hidden: true, hideable: false }, { dataIndex: 'StartDate', id: 'EmployeeTraining_StartDate', text: "Start Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, {

dataIndex: 'EndDate', id: 'EmployeeTraining_EndDate', text: "End Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'PromotorName', id: 'EmployeeTraining_PromotorName', text: "Promotor", width: 120 }, { dataIndex: 'SponsorName', id: 'EmployeeTraining_SponsorName', text: "Sponsor", width: 100 }, { dataIndex: 'InstructorName', id: 'EmployeeTraining_Instructor', text: "Instructor", width: 100 }, { dataIndex: 'CityName', id: 'EmployeeTraining_CityName', text: "City", width: 120 }, { dataIndex: 'CityID', id: 'EmployeeTraining_CityID', hidden: true, hideable: false }, { dataIndex: 'CountryName', id: 'EmployeeTraining_CountryName', text: "Country", width: 120 }, { dataIndex: 'TrainingFeeCurrency', id: 'EmployeeTraining_TrainingFeeCurrency', text: "Fee Currency", width: 100 }, { dataIndex: 'TrainingFee', id: 'EmployeeTraining_TrainingFee', text: "Fee Amount", width: 120 }, { dataIndex: 'Remark', id: 'EmployeeTraining_Remark', text: 'Description', width: 120 }, { dataIndex: 'IsExternal', id: 'EmployeeTraining_IsExternal', text: 'External', width: 120,

align: 'center', renderer: function IsExternal(val, x, store) { if (!val) return ''; else return 'V'; } } ]; //#endregion //#region "Create Employee Training Grid" employeeTrainingGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeTrainingGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeTrainingRecord = record; ShowUpdateEmployeeTrainingForm(dataStore, selectedEmployeeTrai ningRecord); } }, // grid columns: employeeTrainingColumns, tbar: employeeTrainingGridBBar }) //#endregion employeeTrainingGrid.on('itemclick', function (obj, record, item, index, e, options) { selectedEmployeeTrainingRecord = record; }); //#region "Attach Context Menu to Grid" employeeTrainingGrid.on('itemcontextmenu', function (obj, record, item, inde x, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeTrainingGrid'; selectedEmployeeTrainingRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeTrainingGrid; }

//#endregion //#region "Create Employee Certificate Grid" function CreateEmployeeCertificateGrid(dataStore) { //#region "Create BBar" var employeeCertificateGridBBar = new Ext.Toolbar({ id: 'employeeCertificateGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeCertificateForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeCertificateForm(dataStore, selectedEmploye eCertificateRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeCertificateDialog(dataStore, selectedEmplo yeeCertificateRecord); } }] }); //#endregion //#region "Create Employee Certificate Columns Grid" employeeCertificateColumns = [ { dataIndex: 'CertificateName', id: 'EmployeeCertificate_CertificateName', text: "Certificate" }, { dataIndex: 'CertificateID', id: 'EmployeeCertificate_CertificateID', hidden: true, hideable: false }, { dataIndex: 'TakenDate', id: 'EmployeeCertificate_TakenDate', text: "Taken Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') },

{ dataIndex: 'ExpireDate', id: 'EmployeeCertificate_ExpireDate', text: "ExpireDate", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'SpecialityTypeID', id: 'EmployeeCertificate_SpecialityTypeID', hidden: true, hideable: false }, { dataIndex: 'SpecialityTypeName', id: 'EmployeeCertificate_SpecialityTypeName', text: "Speciality", width: 100 }, { dataIndex: 'CertificateLevelID', id: 'EmployeeCertificate_CertificateLevelID', hidden: true, hideable: false }, { dataIndex: 'CertificateLevelName', id: 'EmployeeCertificate_CertificateLevelName', text: "Level", width: 100 }, { dataIndex: 'CertificateInstitutionName', id: 'EmployeeCertificate_CertificateInstitutionName', text: "Institution", width: 100 }, { dataIndex: 'CertificateIssuerName', id: 'EmployeeCertificate_CertificateIssuerName', text: "Issuer", width: 100 }, { dataIndex: 'CertificateIssuerID', id: 'EmployeeCertificate_CertificateIssuerID', hidden: true, hideable: false }, { dataIndex: 'CityName', id: 'EmployeeCertificate_CityName', text: "City", width: 100 }, {

dataIndex: 'CountryName', id: 'EmployeeCertificate_CountryName', text: "Country", width: 100 }, { dataIndex: 'CityID', id: 'EmployeeCertificate_CityID', hidden: true, hideable: false }, { dataIndex: 'Grade', id: 'EmployeeCertificate_Grade', text: "Grade", width: 60 }, { dataIndex: 'Score', id: 'EmployeeCertificate_Score', text: "Score", width: 60 } ]; //#endregion //#region "Create Employee Certificate Grid" employeeCertificateGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeCertificateGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeCertificateRecord = record; ShowUpdateEmployeeCertificateForm(dataStore, selectedEmployeeCe rtificateRecord); } }, // grid columns: employeeCertificateColumns, tbar: employeeCertificateGridBBar }) //#endregion

employeeCertificateGrid.on('itemclick', function (obj, record, item, index, e, options) { selectedEmployeeCertificateRecord = record; }); //#region "Attach Context Menu to Grid" employeeCertificateGrid.on('itemcontextmenu', function (obj, record, item, i ndex, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeCertificateGrid'; selectedEmployeeCertificateRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeCertificateGrid; } //#endregion //#region "Create Employee Scholarship Grid" function CreateEmployeeScholarshipGrid(dataStore) { //#region "Create BBar" var employeeScholarshipGridBBar = new Ext.Toolbar({ id: 'employeeScholarshipGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeScholarshipForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeScholarshipForm(dataStore, selectedEmploye eScholarshipRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeScholarshipDialog(dataStore, selectedEmplo yeeScholarshipRecord); } }] }); //#endregion //#region "Create Employee Scholarship Columns Grid" employeeScholarshipColumns = [ {

dataIndex: 'StartDate', id: 'EmployeeScholarship_StartDateScholarship', text: "Start Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'EndDate', id: 'EmployeeScholarship_EndDate', text: "End Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'ScholarshipName', id: 'EmployeeScholarship_ScholarshipName', text: "Name", flex: 0.2 }, { dataIndex: 'PromotorName', id: 'EmployeeScholarship_PromotorName', text: "Promotor", flex: 0.2 }, { dataIndex: 'InstitutionName', id: 'EmployeeScholarship_InstitutionName', text: "Institution", flex: 0.2 }, { dataIndex: 'ScholarshipDescription', id: 'EmployeeScholarship_ScholarshipDescription', text: "Description", flex: 0.4 } ]; //#endregion //#region "Create Employee Scholarship Grid" employeeScholarshipGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeScholarshipGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeScholarshipRecord = record;

ShowUpdateEmployeeScholarshipForm(dataStore, selectedEmployeeSch olarshipRecord); } }, // grid columns: employeeScholarshipColumns, tbar: employeeScholarshipGridBBar }) //#endregion employeeScholarshipGrid.on('itemclick', function (obj, record, item, index, e, options) { selectedEmployeeScholarshipRecord = record; }); //#region "Attach Context Menu to Grid" employeeScholarshipGrid.on('itemcontextmenu', function (obj, record, item, i ndex, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeScholarshipGrid'; selectedEmployeeScholarshipRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeScholarshipGrid; } //#endregion //#region "Create Employee ExternalWork Grid" function CreateEmployeeExternalWorkGrid(dataStore) { //#region "Create BBar" var employeeExternalWorkGridBBar = new Ext.Toolbar({ id: 'employeeExternalWorkGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeExternalWorkForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeExternalWorkForm(dataStore, selectedEmploy eeExternalWorkRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() {

ShowDeleteEmployeeExternalWorkDialog(dataStore, selectedEmpl oyeeExternalWorkRecord); } }] }); //#endregion //#region "Create Employee ExternalWork Columns Grid" employeeExternalWorkColumns = [ { dataIndex: 'StartDate', id: 'EmployeeExternalWork_StartDate', text: "Start Date", format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'EndDate', id: 'EmployeeExternalWork_EndDate', text: "End Date", format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'JobTitleName', id: 'EmployeeExternalWork_JobTitleName', text: "Job Title", width: 100 }, { dataIndex: 'NumberOfSubordinate', id: 'EmployeeExternalWork_NumberOfSubordinate', text: "No of Subordinate", width: 120 }, { dataIndex: 'SupervisorName', id: 'EmployeeExternalWork_SupervisorName', text: "Supervisor", width: 100 }, { dataIndex: 'SupervisorTitleName', id: 'EmployeeExternalWork_SupervisorTitleName', text: "Job Title of Supervisor", width: 130 }, { dataIndex: 'LineOfBusinessName', id: 'EmployeeExternalWork_LineOfBusinessName', text: "Line of Business", width: 100 }, { dataIndex: 'LineOfBusinessID', id: 'EmployeeExternalWork_LineOfBusinessID', hidden: true, hideable: false

}, { dataIndex: 'CompanyName', id: 'EmployeeExternalWork_CompanyName', text: "Company", width: 100 }, { dataIndex: 'CityName', id: 'EmployeeExternalWork_CityName', text: "City", width: 120 }, { dataIndex: 'CityID', id: 'EmployeeExternalWork_CityID', hidden: true, hideable: false }, { dataIndex: 'CountryName', id: 'EmployeeExternalWork_CountryName', text: "Country", width: 120 }, { dataIndex: 'SalaryCurrencyCode', id: 'EmployeeExternalWork_SalaryCurrencyCode', text: "Salary Currency", width: 100 }, { dataIndex: 'SalaryAmount', id: 'EmployeeExternalWork_SalaryAmount', text: "Salary Amount", width: 100 }, { dataIndex: 'ReasonToLeave', id: 'EmployeeExternalWork_ReasonToLeave', text: "Reason to Leave", width: 100 } ]; //#endregion //#region "Create Employee ExternalWork Grid" employeeExternalWorkGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeExternalWorkGrid', width: '100%', height: '100%', disableSelection: false,

loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeExternalWorkRecord = record; ShowUpdateEmployeeExternalWorkForm(dataStore, selectedEmployeeEx ternalWorkRecord); } }, // grid columns: employeeExternalWorkColumns, tbar: employeeExternalWorkGridBBar }) //#endregion employeeExternalWorkGrid.on('itemclick', function (obj, record, item , index, e, options) { selectedEmployeeExternalWorkRecord = record; }); //#region "Attach Context Menu to Grid" employeeExternalWorkGrid.on('itemcontextmenu', function (obj, record, item, index, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeExternalWorkGrid'; selectedEmployeeExternalWorkRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeExternalWorkGrid; } //#endregion //#region "Create Employee Organization Grid" function CreateEmployeeOrganizationGrid(dataStore) { //#region "Create BBar" var employeeOrganizationGridBBar = new Ext.Toolbar({ id: 'employeeOrganizationGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeOrganizationForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () {

ShowUpdateEmployeeOrganizationForm(dataStore, selectedEmploy eeOrganizationRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeOrganizationDialog(dataStore, selectedEmpl oyeeOrganizationRecord); } }] }); //#endregion //#region "Create Employee Organization Columns Grid" employeeOrganizationColumns = [ { dataIndex: 'OrganizationName', id: 'EmployeeOrganization_OrganizationName', text: "Name", flex: 0.25 }, { dataIndex: 'StartDate', id: 'EmployeeOrganization_StartDate', text: "Start Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'EndDate', id: 'EmployeeOrganization_EndDate', text: "End Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'Position', id: 'EmployeeOrganization_Position', text: "Position", flex: 0.25 }, { dataIndex: 'OrganizationFieldName', id: 'EmployeeOrganization_OrganizationFieldName', text: "Field", flex: 0.25 }, { dataIndex: 'OrganizationFieldID', id: 'EmployeeOrganization_OrganizationFieldID', hidden: true, hideable: false },

{ dataIndex: 'CityName', id: 'EmployeeOrganization_CityName', text: "City", flex: 0.25 }, { dataIndex: 'CityID', id: 'EmployeeOrganization_CityID', hidden: true, hideable: false }, { dataIndex: 'CountryName', id: 'EmployeeOrganization_CountryName', text: "Country", flex: 0.25 }, ]; //#endregion //#region "Create Employee Organization Grid" employeeOrganizationGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeOrganizationGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeOrganizationRecord = record; ShowUpdateEmployeeOrganizationForm(dataStore, selectedEmployeeO rganizationRecord); } }, // grid columns: employeeOrganizationColumns, tbar: employeeOrganizationGridBBar }) //#endregion employeeOrganizationGrid.on('itemclick', function (obj, record, item , index, e, options) { selectedEmployeeOrganizationRecord = record; });

//#region "Attach Context Menu to Grid" employeeOrganizationGrid.on('itemcontextmenu', function (obj, record, item, index, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeOrganizationGrid'; selectedEmployeeOrganizationRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeOrganizationGrid; } //#endregion //#region "Create Employee MilitaryConscript Grid" function CreateEmployeeMilitaryConscriptGrid(dataStore) { //#region "Create BBar" var employeeMilitaryConscriptGridBBar = new Ext.Toolbar({ id: 'employeeMilitaryConscriptGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeMilitaryConscriptForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeMilitaryConscriptForm(dataStore, selectedE mployeeMilitaryConscriptRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeMilitaryConscriptDialog(dataStore, selecte dEmployeeMilitaryConscriptRecord); } }] }); //#endregion //#region "Create Employee MilitaryConscript Columns Grid" employeeMilitaryConscriptColumns = [ { dataIndex: 'StartDate', id: 'EmployeeMilitaryConscript_StartDate', text: "Start Date", width: 90, format: 'd/m/Y',

renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'EndDate', id: 'EmployeeMilitaryConscript_EndDate', text: "End Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'MilitaryBranchName', id: 'EmployeeMilitaryConscript_MilitaryBranchName', text: "Military Branch", width: 100 }, { dataIndex: 'MilitaryBranchID', id: 'EmployeeMilitaryConscript_MilitaryBranchID', hidden: true, hideable: false }, { dataIndex: 'CityName', id: 'EmployeeMilitaryConscript_CityName', text: "City", flex: 0.2 }, { dataIndex: 'CityID', id: 'EmployeeMilitaryConscript_CityID', hidden: true, hideable: false }, { dataIndex: 'CountryName', id: 'EmployeeMilitaryConscript_CountryName', text: "Country", flex: 0.2 }, { dataIndex: 'HighestRank', id: 'EmployeeMilitaryConscript_HighestRank', text: "Highest Rank", flex: 0.2 }, { dataIndex: 'AssignedTo', id: 'EmployeeMilitaryConscript_AssignedtTo', text: "Assigned to", flex: 0.2 }, { dataIndex: 'Remark', id: 'EmployeeMilitaryConscript_Remark', text: "Remark", flex: 0.4 }

]; //#endregion //#region "Create Employee MilitaryConscript Grid" employeeMilitaryConscriptGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeMilitaryConscriptGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeMilitaryConscriptRecord = record; ShowUpdateEmployeeMilitaryConscriptForm(dataStore, selectedEmplo yeeMilitaryConscriptRecord); } }, // grid columns: employeeMilitaryConscriptColumns, tbar: employeeMilitaryConscriptGridBBar }) //#endregion employeeMilitaryConscriptGrid.on('itemclick', function (obj, record, item, index, e, options) { selectedEmployeeMilitaryConscriptRecord = record; }); //#region "Attach Context Menu to Grid" employeeMilitaryConscriptGrid.on('itemcontextmenu', function (obj, record, i tem, index, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeMilitaryConscriptGrid'; selectedEmployeeMilitaryConscriptRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeMilitaryConscriptGrid; } //#endregion //#region "Create Employee Award Grid" function CreateEmployeeAwardGrid(dataStore) {

//#region "Create BBar" var employeeAwardGridBBar = new Ext.Toolbar({ id: 'employeeAwardGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeAwardForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeAwardForm(dataStore, selectedEmployeeAward Record) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeAwardDialog(dataStore, selectedEmployeeAwa rdRecord); } }] }); //#endregion //#region "Create Employee Award Columns Grid" employeeAwardColumns = [ { dataIndex: 'AwardName', id: 'EmployeeAward_AwardName', text: "Name", flex: 0.25 }, { dataIndex: 'GivenDate', id: 'EmployeeAward_GivenDate', text: "Given Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'InstitutionName', id: 'EmployeeAward_InstitutionName', text: "Institution", flex: 0.25 }, { dataIndex: 'AwardDescription', id: 'EmployeeAward_AwardDescription', text: "Description",

flex: 0.5 } ]; //#endregion //#region "Create Employee Award Grid" employeeAwardGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeAwardGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeAwardRecord = record; ShowUpdateEmployeeAwardForm(dataStore, selectedEmployeeAwardReco rd); } }, // grid columns: employeeAwardColumns, tbar: employeeAwardGridBBar }) //#endregion employeeAwardGrid.on('itemclick', function (obj, record, item, index , e, options) { selectedEmployeeAwardRecord = record; }); //#region "Attach Context Menu to Grid" employeeAwardGrid.on('itemcontextmenu', function (obj, record, item, index, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeAwardGrid'; selectedEmployeeAwardRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeAwardGrid; } //#endregion

//#region "Create Employee Language Grid" function CreateEmployeeLanguageGrid(dataStore) { //#region "Create BBar" var employeeLanguageGridBBar = new Ext.Toolbar({ id: 'employeeLanguageGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeLanguageForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeLanguageForm(dataStore, selectedEmployeeLa nguageRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeLanguageDialog(dataStore, selectedEmployee LanguageRecord); } }] }); //#endregion //#region "Create Employee Language Columns Grid" employeeLanguageColumns = [ { dataIndex: 'LanguageName', id: 'EmployeeLanguage_LanguageName', text: "Language", width: 160 }, { dataIndex: 'LanguageID', id: 'EmployeeLanguage_LanguageID', hidden: true, hideable: false }, { dataIndex: 'ReadingProficiency', id: 'EmployeeLanguage_ReadingProficiency', text: "Reading", flex: 0.25 }, { dataIndex: 'ReadingProficiencyID', id: 'EmployeeLanguage_ReadingProficiencyID',

hidden: true, hideable: false }, { dataIndex: 'WrittingProficiency', id: 'EmployeeLanguage_WrittingProficiency', text: "Writing", flex: 0.25 }, { dataIndex: 'WrittingProficiencyID', id: 'EmployeeLanguage_WrittingProficiencyID', hidden: true, hideable: false }, { dataIndex: 'SpeakingProficiency', id: 'EmployeeLanguage_SpeakingProficiency', text: "Speaking", flex: 0.25 }, { dataIndex: 'SpeakingProficiencyID', id: 'EmployeeLanguage_SpeakingProficiencyID', hidden: true, hideable: false }, { dataIndex: 'ListeningProficiency', id: 'EmployeeLanguage_ListeningProficiency', text: "Listening", flex: 0.25 }, { dataIndex: 'ListeningProficiencyID', id: 'EmployeeLanguage_ListeningProficiencyID', hidden: true, hideable: false } ]; //#endregion //#region "Create Employee Language Grid" employeeLanguageGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeLanguageGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true,

columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeLanguageRecord = record; ShowUpdateEmployeeLanguageForm(dataStore, selectedEmployeeLangua geRecord); } }, // grid columns: employeeLanguageColumns, tbar: employeeLanguageGridBBar }) //#endregion employeeLanguageGrid.on('itemclick', function (obj, record, item, in dex, e, options) { selectedEmployeeLanguageRecord = record; }); //#region "Attach Context Menu to Grid" employeeLanguageGrid.on('itemcontextmenu', function (obj, record, item, inde x, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeLanguageGrid'; selectedEmployeeLanguageRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeLanguageGrid; } //#endregion //#region "Create Employee Hobby Grid" function CreateEmployeeHobbyGrid(dataStore) { //#region "Create BBar" var employeeHobbyGridBBar = new Ext.Toolbar({ id: 'employeeHobbyGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeHobbyForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () {

ShowUpdateEmployeeHobbyForm(dataStore, selectedEmployeeHobby Record) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeHobbyDialog(dataStore, selectedEmployeeHob byRecord); } }] }); //#endregion //#region "Create Employee Hobby Columns Grid" employeeHobbyColumns = [ { dataIndex: 'HobbyTypeName', id: 'EmployeeHobby_HobbyTypeName', text: "Type", flex: 0.3 }, { dataIndex: 'HobbyTypeID', id: 'EmployeeHobby_HobbyTypeID', hidden: true, hideable: false }, { dataIndex: 'HobbyName', id: 'EmployeeHobby_HobbyName', text: "Hobby Name", flex: 0.7 }, ]; //#endregion //#region "Create Employee Hobby Grid" employeeHobbyGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeHobbyGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda

}, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeHobbyRecord = record; ShowUpdateEmployeeHobbyForm(dataStore, selectedEmployeeHobbyReco rd); } }, // grid columns: employeeHobbyColumns, tbar: employeeHobbyGridBBar }) //#endregion employeeHobbyGrid.on('itemclick', function (obj, record, item, index , e, options) { selectedEmployeeHobbyRecord = record; }); //#region "Attach Context Menu to Grid" employeeHobbyGrid.on('itemcontextmenu', function (obj, record, item, index, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeHobbyGrid'; selectedEmployeeHobbyRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeHobbyGrid; } //#endregion //#region "Create Employee Health Grid" function CreateEmployeeHealthGrid(dataStore) { //#region "Create BBar" var employeeHealthGridBBar = new Ext.Toolbar({ id: 'employeeHealthGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeHealthForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeHealthForm(dataStore, selectedEmployeeHeal thRecord) } }, { iconCls: 'grid-delete-icon',

text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeHealthDialog(dataStore, selectedEmployeeHe althRecord); } }] }); //#endregion //#region "Create Employee Health Columns Grid" employeeHealthColumns = [ { dataIndex: 'StartDate', id: 'EmployeeHealth_StartDate', text: "Start Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'EndDate', id: 'EmployeeHealth_EndDate', text: "End Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'IllnessName', id: 'EmployeeHealth_IllnessName', text: "Illness Name", width: 160 }, { dataIndex: 'IllnessDescription', id: 'EmployeeHealth_IllnessDescription', text: "Description", flex: 1 } ]; //#endregion //#region "Create Employee Health Grid" employeeHealthGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeHealthGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: {

trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeHealthRecord = record; ShowUpdateEmployeeHealthForm(dataStore, selectedEmployeeHealthR ecord); } }, // grid columns: employeeHealthColumns, tbar: employeeHealthGridBBar }) //#endregion employeeHealthGrid.on('itemclick', function (obj, record, item, inde x, e, options) { selectedEmployeeHealthRecord = record; }); //#region "Attach Context Menu to Grid" employeeHealthGrid.on('itemcontextmenu', function (obj, record, item, index, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeHealthGrid'; selectedEmployeeHealthRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeHealthGrid; } //#endregion //#region "Create Employee Reference Grid" function CreateEmployeeReferenceGrid(dataStore) { //#region "Create BBar" var employeeReferenceGridBBar = new Ext.Toolbar({ id: 'employeeReferenceGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeReferenceForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeReferenceForm(dataStore, selectedEmployeeR eferenceRecord)

} }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeReferenceDialog(dataStore, selectedEmploye eReferenceRecord); } }] }); //#endregion //#region "Create Employee Reference Columns Grid" employeeReferenceColumns = [ { dataIndex: 'FirstName', id: 'EmployeeReference_FirstNameReference', text: "First Name", width: 100 }, { dataIndex: 'LastName', id: 'EmployeeReference_LastName', text: "Last Name", width: 100 }, { dataIndex: 'ReferenceRelation', id: 'EmployeeReference_ReferenceRelation', text: "Relation", width: 120 }, { dataIndex: 'ReferenceAddress', id: 'EmployeeReference_ReferenceAddress', text: "Address", width: 100 }, { dataIndex: 'CityName', id: 'EmployeeReference_CityName', text: "City", width: 100 }, { dataIndex: 'CityID', id: 'EmployeeReference_CityID', hidden: true, hideable: false }, { dataIndex: 'CountryName', id: 'EmployeeReference_CountryName', text: "Country", width: 100 },

{ dataIndex: 'PostalCode', id: 'EmployeeReference_PostalCode', text: "Postal Code", width: 100 }, { dataIndex: 'ContactNumber', id: 'EmployeeReference_ContactNumber', text: "Contact Number", width: 120 }, { dataIndex: 'IsContactable', id: 'EmployeeReference_IsContactable', text: "Contactable", width: 100, align: 'center', renderer: function IsContactable(val, x, store) { if (!val) return ' '; else return 'V'; } }, { dataIndex: 'EmailAddress', id: 'EmployeeReference_EmailAddress', text: "Email", width: 100 }, { dataIndex: 'NationalityName', id: 'EmployeeReference_NationalityName', text: "Nationality", width: 100 }, { dataIndex: 'NationalityID', id: 'EmployeeReference_NationalityID', hidden: true, hideable: false }, { dataIndex: 'JobTitleName', id: 'EmployeeReference_JobTitleName', text: "Job Title", width: 120 }, { dataIndex: 'CompanyName', id: 'EmployeeReference_CompanyName', text: "Company", width: 100 }, { dataIndex: 'YearKnown', id: 'EmployeeReference_YearKnown', text: "YearKnown", width: 100 } ]; //#endregion

//#region "Create Employee Reference Grid" employeeReferenceGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeReferenceGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeReferenceRecord = record; ShowUpdateEmployeeReferenceForm(dataStore, selectedEmployeeRefe renceRecord); } }, // grid columns: employeeReferenceColumns, tbar: employeeReferenceGridBBar }) //#endregion employeeReferenceGrid.on('itemclick', function (obj, record, item, i ndex, e, options) { selectedEmployeeReferenceRecord = record; }); //#region "Attach Context Menu to Grid" employeeReferenceGrid.on('itemcontextmenu', function (obj, record, item, ind ex, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeReferenceGrid'; selectedEmployeeReferenceRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeReferenceGrid; } //#endregion //#region "Create Employee QuestionTask Grid" function CreateEmployeeQuestionTaskGrid(dataStore) { //#region "Create BBar" var employeeQuestionTaskGridBBar = new Ext.Toolbar({

id: 'employeeQuestionTaskGridBBar', items: [{ iconCls: 'grid-add-icon', text: 'Add', scope: this, handler: function () { ShowInsertEmployeeQuestionTaskForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeQuestionTaskForm(dataStore, selectedEmploy eeQuestionTaskRecord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeQuestionTaskDialog(dataStore, selectedEmpl oyeeQuestionTaskRecord); } }] }); //#endregion //#region "Create Employee QuestionTask Columns Grid" employeeQuestionTaskColumns = [ { dataIndex: 'QuestionTaskDescription', id: 'EmployeeQuestionTask_QuestionTaskDescription', text: "Question Task", flex: 0.5 }, { dataIndex: 'QuestionTaskID', id: 'EmployeeQuestionTask_QuestionTaskID', hidden: true, hideable: false }, { dataIndex: 'AnswerDescription', id: 'EmployeeQuestionTask_AnswerDescription', text: "Answer Description", flex: 0.5 } ]; //#endregion //#region "Create Employee QuestionTask Grid" employeeQuestionTaskGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true,

enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeQuestionTaskGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeQuestionTaskRecord = record; ShowUpdateEmployeeQuestionTaskForm(dataStore, selectedEmployeeQu estionTaskRecord); } }, // grid columns: employeeQuestionTaskColumns, tbar: employeeQuestionTaskGridBBar }) //#endregion employeeQuestionTaskGrid.on('itemclick', function (obj, record, item , index, e, options) { selectedEmployeeQuestionTaskRecord = record; }); //#region "Attach Context Menu to Grid" employeeQuestionTaskGrid.on('itemcontextmenu', function (obj, record, item, index, e, options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeQuestionTaskGrid'; selectedEmployeeQuestionTaskRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeQuestionTaskGrid; } //#endregion //#region "Create Employee Exam Grid" function CreateEmployeeExamGrid(dataStore) { //#region "Create BBar" var employeeExamGridBBar = new Ext.Toolbar({ id: 'employeeExamGridBBar', items: [{ iconCls: 'grid-add-icon',

text: 'Add', scope: this, handler: function () { ShowInsertEmployeeExamForm(dataStore) } }, { iconCls: 'grid-update-icon', text: 'Update', scope: this, handler: function () { ShowUpdateEmployeeExamForm(dataStore, selectedEmployeeExamRe cord) } }, { iconCls: 'grid-delete-icon', text: 'Delete', scope: this, handler: function() { ShowDeleteEmployeeExamDialog(dataStore, selectedEmployeeExam Record); } }] }); //#endregion //#region "Create Employee Exam Columns Grid" employeeExamColumns = [ { dataIndex: 'ExamName', id: 'EmployeeExam_ExamName', text: "Exam", flex: 1 }, { dataIndex: 'TakenDate', id: 'EmployeeExam_TakenDate', text: "Taken Date", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'ExpireDate', id: 'EmployeeExam_ExpireDate', text: "ExpireDate", width: 90, format: 'd/m/Y', renderer: Ext.util.Format.dateRenderer('d/m/Y') }, { dataIndex: 'CertificateIssuerName', id: 'EmployeeExam_CertificateIssuerName', text: "Issuer", width: 100 }, { dataIndex: 'CityName', id: 'EmployeeExam_CityName',

text: "City", width: 100 }, { dataIndex: 'CountryName', id: 'EmployeeExam_CountryName', text: "Country", width: 100 }, { dataIndex: 'Grade', id: 'EmployeeExam_Grade', text: "Grade", width: 60 }, { dataIndex: 'Score', id: 'EmployeeExam_Score', text: "Score", width: 60 }, { dataIndex: 'IsPassed', id: 'EmployeeExam_IsPassed', text: "Is Passed", width: 120, align: 'center', renderer: function IsPassed(val, x, store) { if (!val) return ''; el se return 'V'; } } ]; //#endregion //#region "Create Employee Exam Grid" employeeExamGrid = Ext.create('Ext.grid.Panel', { enableColumnMove: false, enableDragDrop: false, enableHdMenu: true, enableColumnHide: false, sortableColumns: true, store: dataStore, id: 'employeeExamGrid', width: '100%', height: '100%', disableSelection: false, loadMask: true, columnLines: true, viewConfig: { trackOver: false, stripeRows: true//warna row warna beda }, listeners: { itemdblclick: function (dv, record, item, index, e) { selectedEmployeeExamRecord = record; ShowUpdateEmployeeExamForm(dataStore, selectedEmployeeExamRecord ); } },

// grid columns: employeeExamColumns, tbar: employeeExamGridBBar }) //#endregion employeeExamGrid.on('itemclick', function (obj, record, item, index, e, opti ons) { selectedEmployeeExamRecord = record; }); //#region "Attach Context Menu to Grid" employeeExamGrid.on('itemcontextmenu', function (obj, record, item, index, e , options) { e.stopEvent(); if (__IsEditMode) { __SelectedGridId = 'employeeExamGrid'; selectedEmployeeExamRecord = record; gridContextMenu.showAt(e.xy); } }); //#endregion return employeeExamGrid; } //#endregion //#region "Fill Employee Data To Form" function FillData(index) { switch (index) { //#region "Employee Basic Fields" case 0: //employeeWindow.setLoading(true); topEmployeeForm.getForm().findField("EmployeeNoDisplay").setValue(_S electedEmployeeRecord.EmployeeNo); topEmployeeForm.getForm().findField("FirstNameDisplay").setValue(_Se lectedEmployeeRecord.FirstName); topEmployeeForm.getForm().findField("LastNameDisplay").setValue(_Sel ectedEmployeeRecord.LastName); if (trim(_SelectedEmployeeRecord.PictureFile) == '') Ext.getCmp('EmployeePictureImage').getEl().dom.src = '../Image/E mployeePhoto/BlankPhoto.png'; else Ext.getCmp('EmployeePictureImage').getEl().dom.src = _SelectedEm ployeeRecord.PictureFile; break; //employeeWindow.setLoading(false); //#endregion //#region "Personal Details Tab" case 1: var isTab1Loaded; var isBloodTypeLoaded; var isReligionLoaded; var isEtnicLoaded; var isMaritalLoaded;

isTab1Loaded = false; isBloodTypeLoaded = false; isReligionLoaded = false; isEtnicLoaded = false; isMaritalLoaded = false; employeeInput.getForm().findField("SalutationName").setValue(_Select edEmployeeRecord.SalutationName); employeeInput.getForm().findField("FirstName").setValue(_SelectedEmp loyeeRecord.FirstName); employeeInput.getForm().findField("LastName").setValue(_SelectedEmpl oyeeRecord.LastName); employeeInput.getForm().findField("NickName").setValue(_SelectedEmpl oyeeRecord.NickName); if (_SelectedEmployeeRecord.Gender) { employeeInput.getForm().findField("Gender").setValue('1'); } else { employeeInput.getForm().findField("Gender").setValue('0'); } bloodTypeDataStore.load({ callback: function () { bloodTypeComboBox = employeeInput.getForm().findField("Blood TypeID"); bloodTypeComboBox.setValue(_SelectedEmployeeRecord.BloodType ID); bloodTypeComboBox.fireEvent("select"); isBloodTypeLoaded = true; if (isTab1Loaded && isBloodTypeLoaded && isReligionLoaded && isEtnicLoaded && isMaritalLoaded) { employeeWindow.setLoading(false); } } }); religionDataStore.load({ callback: function () { religionComboBox = employeeInput.getForm().findField("Religi onID"); religionComboBox.setValue(_SelectedEmployeeRecord.ReligionID ); religionComboBox.fireEvent("select"); isReligionLoaded = true; if (isTab1Loaded && isBloodTypeLoaded && isReligionLoaded && isEtnicLoaded && isMaritalLoaded) { employeeWindow.setLoading(false); } } }); employeeInput.getForm().findField("Height").setValue(_SelectedEmploy eeRecord.Height); employeeInput.getForm().findField("Weight").setValue(_SelectedEmploy eeRecord.Weight); employeeInput.getForm().findField("BirthDate").setValue(_SelectedEmp loyeeRecord.BirthDate); employeeInput.getForm().findField("BirthCityName").setValue(_Selecte dEmployeeRecord.BirthCityName); employeeInput.getForm().findField("BirthCityID").setValue(_SelectedE mployeeRecord.BirthCityID); employeeInput.getForm().findField("BirthProvinceStateName").setValue

(_SelectedEmployeeRecord.BirthProvinceStateName); employeeInput.getForm().findField("BirthCountryName").setValue(_Sele ctedEmployeeRecord.BirthCountryName); etnicDataStore.load({ callback: function () { etnicComboBox = employeeInput.getForm().findField("EtnicID") ; etnicComboBox.setValue(_SelectedEmployeeRecord.EtnicID); etnicComboBox.fireEvent("select"); isEtnicLoaded = true; if (isTab1Loaded && isBloodTypeLoaded && isReligionLoaded && isEtnicLoaded && isMaritalLoaded) { employeeWindow.setLoading(false); } } }); employeeInput.getForm().findField("NationalityCountryName").setValue (_SelectedEmployeeRecord.NationalityCountryName); employeeInput.getForm().findField("NationalityCountryID").setValue(_ SelectedEmployeeRecord.NationalityCountryID); maritalStatusDataStore.load({ callback: function () { maritalStatusComboBox = employeeInput.getForm().findField("M aritalStatusID"); maritalStatusComboBox.setValue(_SelectedEmployeeRecord.Marit alStatusID); maritalStatusComboBox.fireEvent("select"); var selectedRecordComboBox = maritalStatusDataStore.getById( _SelectedEmployeeRecord.MaritalStatusID); if (selectedRecordComboBox != undefined) { if (selectedRecordComboBox.data.IsMarital == '0') { employeeInput.getForm().findField("MarriageDate").se tDisabled(true); employeeInput.getForm().findField("TaxStatus_Marital Status").setValue("TK"); } else { employeeInput.getForm().findField("MarriageDate").se tDisabled(false); employeeInput.getForm().findField("TaxStatus_Marital Status").setValue("K"); } } else { employeeInput.getForm().findField("MarriageDate").setDis abled(true); employeeInput.getForm().findField("TaxStatus_MaritalStat us").setValue(""); } isMaritalLoaded = true; if (isTab1Loaded && isBloodTypeLoaded && isReligionLoaded && isEtnicLoaded && isMaritalLoaded) { employeeWindow.setLoading(false); } } }); employeeInput.getForm().findField("MarriageDate").setValue(_Selected EmployeeRecord.MarriageDate);

isTab1Loaded = true; if (isTab1Loaded && isBloodTypeLoaded && isReligionLoaded && isEtnic Loaded && isMaritalLoaded) { employeeWindow.setLoading(false); } break; //#endregion //#region "Contact Details Tab" case 2: //employeeWindow.setLoading(true); employeeContactDataStore.proxy.url = '../handler/HRISHandler.aspx?op r=1006&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeContactDataStore.read(); break; //#endregion //#region "Addresses Tab" case 3: //employeeWindow.setLoading(true); employeeAddressDataStore.proxy.url = '../handler/HRISHandler.aspx?op r=1007&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeAddressDataStore.read(); break; //#endregion //#region "Emergency Address Tab" case 4: employeeWindow.setLoading(true); employeeEmergencyAddressDataStore.proxy.url = '../handler/HRISHandle r.aspx?opr=1008&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeEmergencyAddressDataStore.read(); break; //#endregion //#region "Identity Cards Tab" case 5: //employeeWindow.setLoading(true); employeeIdentificationDataStore.proxy.url = '../handler/HRISHandler. aspx?opr=1009&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeIdentificationDataStore.read(); break; //#endregion //#region "Family Structures Tab" case 6: //employeeWindow.setLoading(true); employeeFamilyDataStore.proxy.url = '../handler/HRISHandler.aspx?opr =1010&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeFamilyDataStore.read(); break; //#endregion //#region "Employment Status Tab" case 7: var isTab7Loaded; var isJobTitleLoaded; var isEmploymentStatusLoaded; var isJobGradeLoaded; var isJobLevelLoaded;

isTab7Loaded = false; isJobTitleLoaded = false; isEmploymentStatusLoaded = false; isJobGradeLoaded = false; isJobLevelLoaded = false; employeeWindow.setLoading(true); employeeInput.getForm().findField("JobTitlePublish").setValue(_Selec tedEmployeeRecord.JobTitlePublish); jobTitleDataStore.load({ callback: function () { jobTitleComboBox = employeeInput.getForm().findField("JobTit leID"); jobTitleComboBox.setValue(_SelectedEmployeeRecord.JobTitleID ); jobTitleComboBox.fireEvent("select"); isJobTitleLoaded = true; if (isTab7Loaded && isJobTitleLoaded && isEmploymentStatusLo aded && isJobGradeLoaded && isJobLevelLoaded) { isEmploymentStatusTabShowed = true; employeeWindow.setLoading(false); } } }); employeeInput.getForm().findField("GroupName").setValue(_SelectedEmp loyeeRecord.GroupName); employeeInput.getForm().findField("DivisionName").setValue(_Selected EmployeeRecord.DivisionName); employeeInput.getForm().findField("DepartmentName").setValue(_Select edEmployeeRecord.DepartmentName); employeeInput.getForm().findField("DepartmentID").setValue(_Selected EmployeeRecord.DepartmentID); employeeInput.getForm().findField("OfficeLocationName").setValue(_Se lectedEmployeeRecord.OfficeLocationName); employeeInput.getForm().findField("OfficeLocationID").setValue(_Sele ctedEmployeeRecord.OfficeLocationID); employmentStatusDataStore.load({ callback: function () { employmentStatusComboBox = employeeInput.getForm().findField ("EmploymentStatusIDEmployee"); employmentStatusComboBox.setValue(_SelectedEmployeeRecord.Em ploymentStatusID); employmentStatusComboBox.fireEvent("select"); var selectedRecordComboBox = employmentStatusDataStore.getBy Id(_SelectedEmployeeRecord.EmploymentStatusID); if (selectedRecordComboBox != undefined) { if (selectedRecordComboBox.data.IsResign == '0') { employeeInput.getForm().findField("ReasonToResignID" ).setDisabled(true); employeeInput.getForm().findField("ResignDate").setD isabled(true); } else { employeeInput.getForm().findField("ReasonToResignID" ).setDisabled(false); employeeInput.getForm().findField("ResignDate").setD isabled(false); }

} else { employeeInput.getForm().findField("ReasonToResignID").se tDisabled(true); employeeInput.getForm().findField("ResignDate").setDisab led(true); } isEmploymentStatusLoaded = true; if (isTab7Loaded && isJobTitleLoaded && isEmploymentStatusLo aded && isJobGradeLoaded && isJobLevelLoaded) { isEmploymentStatusTabShowed = true; employeeWindow.setLoading(false); } } }); jobLevelDataStore.load({ callback: function () { jobLevelComboBox = employeeInput.getForm().findField("JobLev elID"); jobLevelComboBox.setValue(_SelectedEmployeeRecord.JobLevelID ); jobLevelComboBox.fireEvent("select"); isJobLevelLoaded = true; if (isTab7Loaded && isJobTitleLoaded && isEmploymentStatusLo aded && isJobGradeLoaded && isJobLevelLoaded) { isEmploymentStatusTabShowed = true; employeeWindow.setLoading(false); } } }); jobGradeDataStore.load({ callback: function () { jobGradeComboBox = employeeInput.getForm().findField("JobGra deID"); jobGradeComboBox.setValue(_SelectedEmployeeRecord.JobGradeID ); jobGradeComboBox.fireEvent("select"); isJobGradeLoaded = true; if (isTab7Loaded && isJobTitleLoaded && isEmploymentStatusLo aded && isJobGradeLoaded && isJobLevelLoaded) { isEmploymentStatusTabShowed = true; employeeWindow.setLoading(false); } } }); employeeInput.getForm().findField("JoinDate").setValue(_SelectedEmpl oyeeRecord.JoinDate); employeeInput.getForm().findField("ReportingTo").setValue(_SelectedE mployeeRecord.ReportingTo); employeeInput.getForm().findField("ReportingToName").setValue(_Selec tedEmployeeRecord.ReportingToName); employeeInput.getForm().findField("ActiveDirectory").setValue(_Selec tedEmployeeRecord.ActiveDirectory); isTab7Loaded = true; if (isTab7Loaded && isJobTitleLoaded && isEmploymentStatusLoaded &&

isJobGradeLoaded && isJobLevelLoaded) { isEmploymentStatusTabShowed = true; employeeWindow.setLoading(false); } break; //#endregion //#region "Resignation Note Tab" case 8: var isReasonToResignLoaded; var isTab8Loaded; isReasonToResignLoaded = false; isTab8Loaded = false; employeeWindow.setLoading(true); employeeInput.getForm().findField("ResignDate").setValue(_SelectedEm ployeeRecord.ResignDate); reasonToResignDataStore.load({ callback: function () { reasonToResignComboBox = employeeInput.getForm().findField(" ReasonToResignID"); reasonToResignComboBox.setValue(_SelectedEmployeeRecord.Reas onToResignID); reasonToResignComboBox.fireEvent("select"); isReasonToResignLoaded = true; if (isReasonToResignLoaded && isTab8Loaded) { isResignationNoteTabShowed = true; employeeWindow.setLoading(false); } } }); isTab8Loaded = true; if (isReasonToResignLoaded && isTab8Loaded) { isResignationNoteTabShowed = true; employeeWindow.setLoading(false); } break; //#endregion //#region "SMS Forwarding To Tab" case 9: //employeeWindow.setLoading(true); employeeReportingToSMSDataStore.proxy.url = '../handler/HRISHandler. aspx?opr=1011&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeReportingToSMSDataStore.read(); break; //#endregion //#region "Internal Working History Tab" case 10: //employeeWindow.setLoading(true); employeeInternalWorkDataStore.proxy.url = '../handler/HRISHandler.as px?opr=1012&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeInternalWorkDataStore.read(); break; //#endregion //#region "Salary and Benefits Tab"

case 11: var isLastMainSalaryCurrency; var isLastAnnualBonusCurrency; var isLastPerformanceBonusCurrency; var isLastBenefitsCurrency; var isExpectedSalaryCurrency; var isTab11; isLastMainSalaryCurrency = false; isLastAnnualBonusCurrency = false; isLastPerformanceBonusCurrency = false; isLastBenefitsCurrency = false; isExpectedSalaryCurrency = false; isTab11 = false; employeeWindow.setLoading(true); lastMainSalaryCurrencyDataStore.load({ callback: function () { lastMainSalaryCurrencyComboBox = employeeInput.getForm().fin dField("LastMainSalaryCurrency"); lastMainSalaryCurrencyComboBox.setValue(_SelectedEmployeeRec ord.LastMainSalaryCurrency); lastMainSalaryCurrencyComboBox.fireEvent("select"); isLastMainSalaryCurrency = true; if (isLastMainSalaryCurrency && isLastAnnualBonusCurrency && isLastPerformanceBonusCurrency && isLastBenefitsCurrency && isExpectedSalaryCur rency && isTab11) { isSalaryandBenefitsTabShowed = true; employeeWindow.setLoading(false); } } }); lastAnnualBonusCurrencyDataStore.load({ callback: function () { lastAnnualBonusCurrencyComboBox = employeeInput.getForm().fi ndField("LastAnnualBonusCurrency"); lastAnnualBonusCurrencyComboBox.setValue(_SelectedEmployeeRe cord.LastAnnualBonusCurrency); lastAnnualBonusCurrencyComboBox.fireEvent("select"); isLastAnnualBonusCurrency = true; if (isLastMainSalaryCurrency && isLastAnnualBonusCurrency && isLastPerformanceBonusCurrency && isLastBenefitsCurrency && isExpectedSalaryCur rency && isTab11) { isSalaryandBenefitsTabShowed = true; employeeWindow.setLoading(false); } } }); lastPerformanceBonusCurrencyDataStore.load({ callback: function () { lastPerformanceBonusCurrencyComboBox = employeeInput.getForm ().findField("LastPerformanceBonusCurrency"); lastPerformanceBonusCurrencyComboBox.setValue(_SelectedEmplo yeeRecord.LastPerformanceBonusCurrency); lastPerformanceBonusCurrencyComboBox.fireEvent("select"); isLastPerformanceBonusCurrency = true; if (isLastMainSalaryCurrency && isLastAnnualBonusCurrency &&

isLastPerformanceBonusCurrency && isLastBenefitsCurrency && isExpectedSalaryCur rency && isTab11) { isSalaryandBenefitsTabShowed = true; employeeWindow.setLoading(false); } } }); lastBenefitsCurrencyDataStore.load({ callback: function () { lastBenefitsCurrencyComboBox = employeeInput.getForm().findF ield("LastBenefitsCurrency"); lastBenefitsCurrencyComboBox.setValue(_SelectedEmployeeRecor d.LastBenefitsCurrency); lastBenefitsCurrencyComboBox.fireEvent("select"); isLastBenefitsCurrency = true; if (isLastMainSalaryCurrency && isLastAnnualBonusCurrency && isLastPerformanceBonusCurrency && isLastBenefitsCurrency && isExpectedSalaryCur rency && isTab11) { isSalaryandBenefitsTabShowed = true; employeeWindow.setLoading(false); } } }); expectedSalaryCurrencyDataStore.load({ callback: function () { expectedSalaryCurrencyComboBox = employeeInput.getForm().fin dField("ExpectedSalaryCurrency"); expectedSalaryCurrencyComboBox.setValue(_SelectedEmployeeRec ord.ExpectedSalaryCurrency); expectedSalaryCurrencyComboBox.fireEvent("select"); isExpectedSalaryCurrency = true; if (isLastMainSalaryCurrency && isLastAnnualBonusCurrency && isLastPerformanceBonusCurrency && isLastBenefitsCurrency && isExpectedSalaryCur rency && isTab11) { isSalaryandBenefitsTabShowed = true; employeeWindow.setLoading(false); } } }); employeeInput.getForm().findField("NoticePeriod").setValue(_Selected EmployeeRecord.NoticePeriod); employeeInput.getForm().findField("LastMainSalaryAmount").setValue(_ SelectedEmployeeRecord.LastMainSalaryAmount); employeeInput.getForm().findField("LastAnnualBonusAmount").setValue( _SelectedEmployeeRecord.LastAnnualBonusAmount); employeeInput.getForm().findField("LastPerformanceBonusAmount").setV alue(_SelectedEmployeeRecord.LastPerformanceBonusAmount); employeeInput.getForm().findField("LastBenefitsAmount").setValue(_Se lectedEmployeeRecord.LastBenefitsAmount); employeeInput.getForm().findField("ExpectedSalaryAmount").setValue(_ SelectedEmployeeRecord.ExpectedSalaryAmount); isTab11 = true; if (isLastMainSalaryCurrency && isLastAnnualBonusCurrency && isLastP erformanceBonusCurrency && isLastBenefitsCurrency && isExpectedSalaryCurrency && isTab11) { isSalaryandBenefitsTabShowed = true; employeeWindow.setLoading(false);

} break; //#endregion //#region "Bank Account and Tax Info Tab" case 12: employeeWindow.setLoading(true); employeeBankAccountDataStore.proxy.url = '../handler/HRISHandler.asp x?opr=1026&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeBankAccountDataStore.read(); //employeeTaxAccountDataStore.proxy.url = '../handler/HRISHandler.as px?opr=1027&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; //employeeTaxAccountDataStore.read(); break; //#endregion //#region "Educational Background Tab" case 13: //employeeWindow.setLoading(true); employeeEducationDataStore.proxy.url = '../handler/HRISHandler.aspx? opr=1013&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeEducationDataStore.read(); break; //#endregion //#region "Trainings and Seminars Tab" case 14: //employeeWindow.setLoading(true); employeeTrainingDataStore.proxy.url = '../handler/HRISHandler.aspx?o pr=1014&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeTrainingDataStore.read(); break; //#endregion //#region "Profesional Certificates Tab" case 15: //employeeWindow.setLoading(true); employeeCertificateDataStore.proxy.url = '../handler/HRISHandler.asp x?opr=1015&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeCertificateDataStore.read(); break; //#endregion //#region "Profesional Exam Tab" case 16: //employeeWindow.setLoading(true); employeeExamDataStore.proxy.url = '../handler/HRISHandler.aspx?opr=1 028&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeExamDataStore.read(); break; //#endregion //#region "Scholarships Tab" case 17: //employeeWindow.setLoading(true); employeeScholarshipDataStore.proxy.url = '../handler/HRISHandler.asp x?opr=1016&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeScholarshipDataStore.read(); break;

//#endregion //#region "External Working History Tab" case 18: //employeeWindow.setLoading(true); employeeExternalWorkDataStore.proxy.url = '../handler/HRISHandler.as px?opr=1017&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeExternalWorkDataStore.read(); break; //#endregion //#region "Social and Political Activities Tab" case 19: //employeeWindow.setLoading(true); employeeOrganizationDataStore.proxy.url = '../handler/HRISHandler.as px?opr=1018&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeOrganizationDataStore.read(); break; //#endregion //#region "Military Conscript Tab" case 20: //employeeWindow.setLoading(true); employeeMilitaryConscriptDataStore.proxy.url = '../handler/HRISHandl er.aspx?opr=1019&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeMilitaryConscriptDataStore.read(); break; //#endregion //#region "Non-Scholarship Awards Tab" case 21: // employeeWindow.setLoading(true); employeeAwardDataStore.proxy.url = '../handler/HRISHandler.aspx?opr= 1020&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeAwardDataStore.read(); break; //#endregion //#region "Language Ability Tab" case 22: //employeeWindow.setLoading(true); employeeLanguageDataStore.proxy.url = '../handler/HRISHandler.aspx?o pr=1021&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeLanguageDataStore.read(); break; //#endregion //#region "Hobby Tab" case 23: //employeeWindow.setLoading(true); employeeHobbyDataStore.proxy.url = '../handler/HRISHandler.aspx?opr= 1022&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeHobbyDataStore.read(); break; //#endregion //#region "Medical Records Tab" case 24: //employeeWindow.setLoading(true); employeeHealthDataStore.proxy.url = '../handler/HRISHandler.aspx?opr

=1023&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeHealthDataStore.read(); break; //#endregion //#region "Reference Details Tab" case 25: //employeeWindow.setLoading(true); employeeReferenceDataStore.proxy.url = '../handler/HRISHandler.aspx? opr=1024&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeReferenceDataStore.read(); //#endregion //#region "Questionnaires Tab" case 26: //employeeWindow.setLoading(true); employeeQuestionTaskDataStore.proxy.url = '../handler/HRISHandler.as px?opr=1025&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeQuestionTaskDataStore.read(); break; //#endregion //#region "Miscellaneous Info Tab" case 27: var worksourceLoaded; var tab27Loaded; worksourceLoaded = false; tab27Loaded = false; employeeWindow.setLoading(true); if (_SelectedEmployeeRecord.IsWillingToTravel) { employeeInput.getForm().findField("IsWillingToTravel").setValue( '1'); } else { employeeInput.getForm().findField("IsWillingToTravel").setValue( '0'); } if (_SelectedEmployeeRecord.IsWillingToRelocated) { employeeInput.getForm().findField("IsWillingToRelocated").setVal ue('1'); } else { employeeInput.getForm().findField("IsWillingToRelocated").setVal ue('0'); } employeeInput.getForm().findField("ReasonToJoin").setValue(_Selected EmployeeRecord.ReasonToJoin); employeeInput.getForm().findField("OtherConsideration").setValue(_Se lectedEmployeeRecord.OtherConsideration); employeeInput.getForm().findField("CareerObjectives").setValue(_Sele ctedEmployeeRecord.CareerObjectives); workSourceDataStore.load({ callback: function () { workSourceComboBox = employeeInput.getForm().findField("Work SourceID"); workSourceComboBox.setValue(_SelectedEmployeeRecord.WorkSour ceID); workSourceComboBox.fireEvent("select"); worksourceLoaded = true;

if (worksourceLoaded && tab27Loaded) { isMiscellaneousInfoTabShowed = true; employeeWindow.setLoading(false); } } }); tab27Loaded = true; if (worksourceLoaded && tab27Loaded) { isMiscellaneousInfoTabShowed = true; employeeWindow.setLoading(false); } break; //#endregion } if (index) _LastTabIndex = index; } //#endregion //#region "Top Info Panel" function CreateTopInfoPanel() { var topEmployeeFormItem = new Ext.create('Ext.form.Panel', { id: 'topEmployeeForm', name: 'topEmployeeForm', bodyStyle: 'padding:5px; background-color: #ffffff;', width: '100%', height: 160, frame: true, border: true, //#endregion items: [ { layout: 'column', border: false, items: [ { columnWidth: .15, border: false, layout: 'anchor', items: [ { xtype: 'box', id: 'EmployeePictureImage', name: 'EmployeePictureImage', autoEl: { style: 'border: solid 1px #EFEFEF;height:113 px;width:113px;padding:10px 10px 0px 10px;border:1px;', tag: 'img', src:'../Image/EmployeePhoto/BlankPhoto.png', onclick: "" } }, { xtype: 'filefield', id: 'employeePhoto-path', //emptyText: 'Select an image', //fieldLabel: 'Photo', autoEl: {

style: 'padding:0px 0px 20px 10px;' }, name: 'employeePhoto-path', buttonOnly: true, hideLabel: true, buttonText: 'Change', listeners: { 'change': function (fb, v) { form = topEmployeeForm.getForm(); form.submit({ waitMsg: 'Uploading your photo...', url: '../handler/UploadHandler.aspx' , params: { opr: '1004', TempFileName: Ext.getCmp('Employ eePictureImage').getEl().dom.src //Id: _SelectedEmployeeRecord.Id }, /* success: function(fp, o) { msg('Success', 'Processed file "' + o.result.file + '" on the server'); } */ success: function (form, action) { //alert(action.result.errormsg); //_SelectedEmployeeRecord.Pictur eFile = action.result.errormsg; Ext.getCmp('EmployeePictureImage ').getEl().dom.src = action.result.errormsg; //employeeDataStore.load(); }, failure: function (form, action) { if (action.failureType === Ext.f orm.Action.CONNECT_FAILURE) { Ext.Msg.alert('Failure', 'Se rver reported:' + action.response.status + ' ' + action.response.statusText); } if (action.failureType === Ext.f orm.Action.SERVER_INVALID) { Ext.Msg.alert('Failed', acti on.result.errormsg); } } }); } } /*, buttonConfig: { iconCls: 'upload-icon' }, */ } ] }, { columnWidth: .85, border: false, layout: 'anchor', defaults: { allowBlank: true,

readOnly: true, labelAlign: 'left', labelWidth: 80, //disabled: true, //anchor: '70%' width: 400 }, defaultType: 'textfield', items: [ { xtype: 'displayfield', value: '&nbsp;' }, { fieldLabel: 'NIK', name: 'EmployeeNoDisplay', width: 200 //allowBlank: false }, { labelStyle: 'color:grey;', fieldLabel: 'First Name', name: 'FirstNameDisplay' }, { labelStyle: 'color:grey;', fieldLabel: 'Last Name', name: 'LastNameDisplay' } ] } ] } ] }); return topEmployeeFormItem; } //#endregion //#region "Create Popup Grid Form" function CreateEmployeeForm() { //#region "Create Context Menu" gridContextMenu = new Ext.menu.Menu({ items: [{ id: 'grid-record-add', iconCls: 'grid-add-icon', text: 'Add' }, { id: 'grid-record-update', iconCls: 'grid-update-icon', text: 'Update' }, { id: 'grid-record-delete', iconCls: 'grid-delete-icon', text: 'Delete' }], listeners: { click: function (menu, item, e, options) { switch (item.id) { case 'grid-record-delete':

switch (__SelectedGridId) { case 'employeeAddressGrid' : ShowDeleteEmployeeAddressDialog(employeeAddressD ataStore, selectedEmployeeAddressRecord); break; case 'employeeContactGrid' : ShowDeleteEmployeeContactDialog(employeeContactD ataStore, selectedEmployeeContactRecord); break; case 'employeeIdentificationGrid' : ShowDeleteEmployeeIdentificationDialog(employeeI dentificationDataStore, selectedEmployeeIdentificationRecord); break; case 'employeeFamilyGrid' : ShowDeleteEmployeeNextOfKinDialog(employeeFamily DataStore, selectedEmployeeNextOfKinRecord); break; case 'employeeInternalWorkGrid' : ShowDeleteEmployeeInternalWorkDialog(employeeInt ernalWorkDataStore, selectedEmployeeInternalWorkRecord); break; case 'employeeReportingToSMSGrid' : ShowDeleteEmployeeReportingToSMSDialog(employeeR eportingToSMSDataStore, selectedEmployeeReportingToSMSRecord); break; case 'employeeEducationGrid' : ShowDeleteEmployeeEducationDialog(employeeEducat ionDataStore, selectedEmployeeEducationRecord); break; case 'employeeTrainingGrid' : ShowDeleteEmployeeTrainingDialog(employeeTrainin gDataStore, selectedEmployeeTrainingRecord); break; case 'employeeCertificateGrid' : ShowDeleteEmployeeCertificateDialog(employeeCert ificateDataStore, selectedEmployeeCertificateRecord); break; case 'employeeScholarshipGrid' : ShowDeleteEmployeeScholarshipDialog(employeeScho larshipDataStore, selectedEmployeeScholarshipRecord); break; case 'employeeExternalWorkGrid' : ShowDeleteEmployeeExternalWorkDialog(employeeExt ernalWorkDataStore, selectedEmployeeExternalWorkRecord); break; case 'employeeOrganizationGrid' : ShowDeleteEmployeeOrganizationDialog(employeeOrg anizationDataStore, selectedEmployeeOrganizationRecord); break; case 'employeeAwardGrid' : ShowDeleteEmployeeAwardDialog(employeeAwardDataS tore, selectedEmployeeAwardRecord); break; case 'employeeMilitaryConscriptGrid' : ShowDeleteEmployeeMilitaryConscriptDialog(employ eeMilitaryConscriptDataStore, selectedEmployeeMilitaryConscriptRecord); break; case 'employeeLanguageGrid' : ShowDeleteEmployeeLanguageDialog(employeeLanguag

eDataStore, selectedEmployeeLanguageRecord); break; case 'employeeHobbyGrid' : ShowDeleteEmployeeHobbyDialog(employeeHobbyDataS tore, selectedEmployeeHobbyRecord); break; case 'employeeHealthGrid' : ShowDeleteEmployeeHealthDialog(employeeHealthDat aStore, selectedEmployeeHealthRecord); break; case 'employeeReferenceGrid' : ShowDeleteEmployeeReferenceDialog(employeeRefere nceDataStore, selectedEmployeeReferenceRecord); break; case 'employeeQuestionTaskGrid' : ShowDeleteEmployeeQuestionTaskDialog(employeeQue stionTaskDataStore, selectedEmployeeQuestionTaskRecord); break; case 'employeeExamGrid' : ShowDeleteEmployeeExamDialog(employeeExamDataSto re, selectedEmployeeExamRecord); break; default: break; } break; case 'grid-record-update': switch (__SelectedGridId) { case 'employeeAddressGrid' : ShowUpdateEmployeeAddressForm(employeeAddressDat aStore, selectedEmployeeAddressRecord); break; case 'employeeMilitaryConscriptGrid' : ShowUpdateEmployeeMilitaryConscriptForm(employee MilitaryConscriptDataStore, selectedEmployeeMilitaryConscriptRecord); break; case 'employeeContactGrid' : ShowUpdateEmployeeContactForm(employeeContactDat aStore, selectedEmployeeContactRecord); break; case 'employeeIdentificationGrid' : ShowUpdateEmployeeIdentificationForm(employeeIde ntificationDataStore, selectedEmployeeIdentificationRecord); break; case 'employeeFamilyGrid' : ShowUpdateEmployeeNextOfKinForm(employeeFamilyDa taStore, selectedEmployeeNextOfKinRecord); break; case 'employeeInternalWorkGrid' : ShowUpdateEmployeeInternalWorkForm(employeeInter nalWorkDataStore, selectedEmployeeInternalWorkRecord); break; case 'employeeReportingToSMSGrid' :

ShowUpdateEmployeeReportingToSMSForm(employeeRep ortingToSMSDataStore, selectedEmployeeReportingToSMSRecord); break; case 'employeeEducationGrid' : ShowUpdateEmployeeEducationForm(employeeEducatio nDataStore, selectedEmployeeEducationRecord); break; case 'employeeTrainingGrid' : ShowUpdateEmployeeTrainingForm(employeeTrainingD ataStore, selectedEmployeeTrainingRecord); break; case 'employeeCertificateGrid' : ShowUpdateEmployeeCertificateForm(employeeCertif icateDataStore, selectedEmployeeCertificateRecord); break; case 'employeeScholarshipGrid' : ShowUpdateEmployeeScholarshipForm(employeeSchola rshipDataStore, selectedEmployeeScholarshipRecord); break; case 'employeeExternalWorkGrid' : ShowUpdateEmployeeExternalWorkForm(employeeExter nalWorkDataStore, selectedEmployeeExternalWorkRecord); break; case 'employeeOrganizationGrid' : ShowUpdateEmployeeOrganizationForm(employeeOrgan izationDataStore, selectedEmployeeOrganizationRecord); break; case 'employeeAwardGrid' : ShowUpdateEmployeeAwardForm(employeeAwardDataSto re, selectedEmployeeAwardRecord); break; case 'employeeLanguageGrid' : ShowUpdateEmployeeLanguageForm(employeeLanguageD ataStore, selectedEmployeeLanguageRecord); break; case 'employeeHobbyGrid' : ShowUpdateEmployeeHobbyForm(employeeHobbyDataSto re, selectedEmployeeHobbyRecord); break; case 'employeeHealthGrid' : ShowUpdateEmployeeHealthForm(employeeHealthDataS tore, selectedEmployeeHealthRecord); break; case 'employeeReferenceGrid' : ShowUpdateEmployeeReferenceForm(employeeReferenc eDataStore, selectedEmployeeReferenceRecord); break; case 'employeeQuestionTaskGrid' :

ShowUpdateEmployeeQuestionTaskForm(employeeQuest ionTaskDataStore, selectedEmployeeQuestionTaskRecord); break; case 'employeeExamGrid' : ShowUpdateEmployeeExamForm(employeeExamDataStore , selectedEmployeeExamRecord); break; default: break; } break; case 'grid-record-add': switch (__SelectedGridId) { case 'employeeAddressGrid' : ShowInsertEmployeeAddressForm(employeeAddressDat aStore); break; case 'employeeContactGrid' : ShowInsertEmployeeContactForm(employeeContactDat aStore); break; case 'employeeIdentificationGrid' : ShowInsertEmployeeIdentificationForm(employeeIde ntificationDataStore); break; case 'employeeFamilyGrid' : ShowInsertEmployeeNextOfKinForm(employeeFamilyDa taStore); break; case 'employeeInternalWorkGrid' : ShowInsertEmployeeInternalWorkForm(employeeInter nalWorkDataStore); break; case 'employeeReportingToSMSGrid' : ShowInsertEmployeeReportingToSMSForm(employeeRep ortingToSMSDataStore); break; case 'employeeEducationGrid' : ShowInsertEmployeeEducationForm(employeeEducatio nDataStore); break; case 'employeeTrainingGrid' : ShowInsertEmployeeTrainingForm(employeeTrainingD ataStore); break; case 'employeeCertificateGrid' : ShowInsertEmployeeCertificateForm(employeeCertif icateDataStore); break; case 'employeeScholarshipGrid' : ShowInsertEmployeeScholarshipForm(employeeSchola rshipDataStore); break; case 'employeeExternalWorkGrid' : ShowInsertEmployeeExternalWorkForm(employeeExter nalWorkDataStore);

break; case 'employeeOrganizationGrid' : ShowInsertEmployeeOrganizationForm(employeeOrgan izationDataStore); break; case 'employeeAwardGrid' : ShowInsertEmployeeAwardForm(employeeAwardDataSto re); break; case 'employeeMilitaryConscriptGrid' : ShowInsertEmployeeMilitaryConscriptForm(employee MilitaryConscriptDataStore); break; case 'employeeQuestionTaskGrid' : ShowInsertEmployeeQuestionTaskForm(employeeQuest ionTaskDataStore); break; case 'employeeReferenceGrid' : ShowInsertEmployeeReferenceForm(employeeReferenc eDataStore); break; case 'employeeLanguageGrid' : ShowInsertEmployeeLanguageForm(employeeLanguageD ataStore); break; case 'employeeHealthGrid' : ShowInsertEmployeeHealthForm(employeeHealthDataS tore); break; case 'employeeHobbyGrid' : ShowInsertEmployeeHobbyForm(employeeHobbyDataSto re); break; case 'employeeExamGrid' : ShowInsertEmployeeExamForm(employeeExamDataStore ); break; default: break; } break; default: break; } } } }); //#endregion //#region "Create BloodType Data Store" bloodTypeDataStore = Ext.create('Ext.data.Store', { //autoload: true, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr= 99907', reader: { type: 'json', root: 'BloodTypeMaster', totalProperty: 'totalCount'

} }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'BloodTypeID', direction: 'ASC' }, pageSize: 50, storeId: 'bloodTypeDataStore', model: 'bloodTypeModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Religion Data Store" religionDataStore = Ext.create('Ext.data.Store', { //autoload: true, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr=99908', reader: { type: 'json', root: 'ReligionMaster', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'ReligionName', direction: 'ASC' }, pageSize: 50, storeId: 'religionDataStore', model: 'religionModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Etnic Data Store" etnicDataStore = Ext.create('Ext.data.Store', { //autoload: true, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr= 99909', reader: { type: 'json', root: 'EtnicMaster', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost',

direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'EtnicID', direction: 'ASC' }, pageSize: 50, storeId: 'etnicDataStore', model: 'etnicModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Marital Status Data Store" maritalStatusDataStore = Ext.create('Ext.data.Store', { //autoload: true, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr= 99910', reader: { type: 'json', root: 'MaritalStatusMaster', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'MaritalStatusID', direction: 'ASC' }, pageSize: 50, storeId: 'maritalStatusDataStore', model: 'maritalStatusModel', waitMsg: 'Loading...' }); //#endregion //#region "Create ReasonToResign Data Store" reasonToResignDataStore = Ext.create('Ext.data.Store', { //autoload: true, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr=99918', reader: { type: 'json', root: 'ReasonToResignMaster', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: {

field: 'ReasonToResignID', direction: 'ASC' }, pageSize: 50, storeId: 'reasonToResignDataStore', model: 'reasonToResignModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Job Title Data Store" jobTitleDataStore = Ext.create('Ext.data.Store', { //autoload: true, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr= 99913', reader: { type: 'json', root: 'JobTitleMaster', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'JobTitleID', direction: 'ASC' }, pageSize: 10000, storeId: 'jobTitleDataStore', model: 'jobTitleModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employment Status Data Store" employmentStatusDataStore = Ext.create('Ext.data.Store', { //autoload: true, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr= 99914', reader: { type: 'json', root: 'EmploymentStatusMaster', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'ApplId', direction: 'ASC' }, pageSize: 50,

storeId: 'employmentStatusDataStore', model: 'employmentStatusModel', waitMsg: 'Loading...' }); //#endregion //#region "Create JobLevel Data Store" jobLevelDataStore = Ext.create('Ext.data.Store', { //autoload: true, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr= 99915', reader: { type: 'json', root: 'JobLevelMaster', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'JobLevelID', direction: 'ASC' }, pageSize: 50, storeId: 'jobLevelDataStore', model: 'jobLevelModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Job Grade Data Store" jobGradeDataStore = Ext.create('Ext.data.Store', { //autoload: true, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr= 99916', reader: { type: 'json', root: 'JobGradeMaster', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'JobGradeID', direction: 'ASC' }, pageSize: 50, storeId: 'jobGradeDataStore', model: 'jobGradeModel', waitMsg: 'Loading...' });

//#endregion //#region "Create WorkSource Data Store" workSourceDataStore = Ext.create('Ext.data.Store', { //autoload: true, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr=99917', reader: { type: 'json', root: 'WorkSourceMaster', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'WorkSourceID', direction: 'ASC' }, pageSize: 50, storeId: 'workSourceDataStore', model: 'workSourceModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Currency Master AX Data Store" lastMainSalaryCurrencyDataStore = Ext.create('Ext.data.Store', { autoDestroy: true, autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr=99903', reader: { type: 'json', root: 'currencyMaster_Ax' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'CURRENCYCODE', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, /*

listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; AddProjectDetailForm.UpdatecurrencyMaster_Ax(); }, scope: this } }, */ pageSize: 1000, storeId: 'lastMainSalaryCurrencyDataStore', model: 'currencyMaster_AxModel', waitMsg: 'Loading...' }); lastAnnualBonusCurrencyDataStore = Ext.create('Ext.data.Store', { autoDestroy: true, autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr=99903', reader: { type: 'json', root: 'currencyMaster_Ax' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'CURRENCYCODE', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, /* listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; AddProjectDetailForm.UpdatecurrencyMaster_Ax(); }, scope: this } }, */ pageSize: 1000, storeId: 'lastAnnualBonusCurrencyDataStore', model: 'currencyMaster_AxModel', waitMsg: 'Loading...' });

lastPerformanceBonusCurrencyDataStore = Ext.create('Ext.data.Store', { autoDestroy: true, autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr=99903', reader: { type: 'json', root: 'currencyMaster_Ax' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'CURRENCYCODE', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, /* listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; AddProjectDetailForm.UpdatecurrencyMaster_Ax(); }, scope: this } }, */ pageSize: 1000, storeId: 'lastPerformanceBonusCurrencyDataStore', model: 'currencyMaster_AxModel', waitMsg: 'Loading...' }); lastBenefitsCurrencyDataStore = Ext.create('Ext.data.Store', { autoDestroy: true, autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr=99903', reader: { type: 'json', root: 'currencyMaster_Ax'

} }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'CURRENCYCODE', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, /* listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; AddProjectDetailForm.UpdatecurrencyMaster_Ax(); }, scope: this } }, */ pageSize: 1000, storeId: 'lastBenefitsCurrencyDataStore', model: 'currencyMaster_AxModel', waitMsg: 'Loading...' }); expectedSalaryCurrencyDataStore = Ext.create('Ext.data.Store', { autoDestroy: true, autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr=99903', reader: { type: 'json', root: 'currencyMaster_Ax' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'CURRENCYCODE', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, /*

listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; AddProjectDetailForm.UpdatecurrencyMaster_Ax(); }, scope: this } }, */ pageSize: 1000, storeId: 'expectedSalaryCurrencyDataStore', model: 'currencyMaster_AxModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Contact Data Store" employeeContactDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx?opr=1016', reader: { type: 'json', root: 'EmployeeContact', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isContactDetailsTabShowed = true; isEmployeeContactDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, remoteSort: false, sortInfo: {

field: 'EmployeeNo', direction: 'ASC' }, pageSize: 50, storeId: 'employeeContactDataStore', model: 'EmployeeContactModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Address Data Store" employeeAddressDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeAddress', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'AddressName', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isAddressesTabShowed = true; isEmployeeAddressDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeAddressDataStore', model: 'EmployeeAddressModel', waitMsg: 'Loading...' });

//#endregion //#region "Create Employee Emergency Address Data Store" employeeEmergencyAddressDataStore = Ext.create('Ext.data.Store', { autoDestroy: true, autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeAddress', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'AddressName', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; if (store.getCount() > 0) { var currentEmergencyAddress = store.getAt(0).data; addressStatusDataStore.load({ callback: function () { EmergencyAddress_AddressStatusComboBox = employe eInput.getForm().findField("EmergencyAddress_AddressStatus"); EmergencyAddress_AddressStatusComboBox.setValue( currentEmergencyAddress.AddressStatusID); EmergencyAddress_AddressStatusComboBox.fireEvent ("select"); } }); employeeInput.getForm().findField("EmergencyAddress_Addr essName").setValue(currentEmergencyAddress.AddressName); employeeInput.getForm().findField("EmergencyAddress_RTCo de").setValue(currentEmergencyAddress.RTCode); employeeInput.getForm().findField("EmergencyAddress_RWCo de").setValue(currentEmergencyAddress.RWCode); employeeInput.getForm().findField("EmergencyAddress_Kelu rahanName").setValue(currentEmergencyAddress.KelurahanName); employeeInput.getForm().findField("EmergencyAddress_Keca matanName").setValue(currentEmergencyAddress.KecamatanName); employeeInput.getForm().findField("EmergencyAddress_City ID").setValue(currentEmergencyAddress.CityID);

employeeInput.getForm().findField("EmergencyAddress_City Name").setValue(currentEmergencyAddress.CityName); employeeInput.getForm().findField("EmergencyAddress_Prov inceStateName").setValue(currentEmergencyAddress.ProvinceStateName); employeeInput.getForm().findField("EmergencyAddress_Coun tryName").setValue(currentEmergencyAddress.CountryName); employeeInput.getForm().findField("EmergencyAddress_Post alCode").setValue(currentEmergencyAddress.PostalCode); employeeInput.getForm().findField("EmergencyAddress_FaxN umber").setValue(currentEmergencyAddress.FaxNumber); employeeInput.getForm().findField("EmergencyAddress_Cont actNo").setValue(currentEmergencyAddress.AddressContact); employeeEmergencyDataStore.proxy.url = '../handler/HRISH andler.aspx?opr=1029&Id=' + currentEmergencyAddress.EmployeeNextOfKinID; employeeEmergencyDataStore.read(); isEmployeeEmergencyAddressDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded() ); } } }, scope: this } }, pageSize: 50, storeId: 'employeeEmergencyAddressDataStore', model: 'EmployeeAddressModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Identification Data Store" employeeIdentificationDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx?', reader: { type: 'json', root: 'EmployeeIdentification', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () {

return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isIdentityCardsTabShowed = true; isEmployeeIdentificationDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeIdentificationDataStore', model: 'EmployeeIdentificationModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Bank Account Data Store" employeeBankAccountDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx?', reader: { type: 'json', root: 'EmployeeIdentification', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; if (store.getCount() > 0) { employeeInput.getForm().findField("BankAccount_Identific ationNo").setValue(store.getAt(0).data.IdentificationNo); employeeInput.getForm().findField("BankAccount_CityId"). setValue(store.getAt(0).data.CityID); employeeInput.getForm().findField("BankAccount_ProvinceS

tateName").setValue(store.getAt(0).data.ProvinceStateName); employeeInput.getForm().findField("BankAccount_CityName" ).setValue(store.getAt(0).data.CityName); } employeeTaxAccountDataStore.proxy.url = '../handler/HRISHand ler.aspx?opr=1027&EmployeeNo=' + _SelectedEmployeeRecord.EmployeeNo; employeeTaxAccountDataStore.read(); isEmployeeBankAccountDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } }, scope: this } }, remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, pageSize: 50, storeId: 'employeeBankAccountDataStore', model: 'EmployeeIdentificationModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Tax Account Data Store" employeeTaxAccountDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx?', reader: { type: 'json', root: 'EmployeeIdentification', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true;

if (store.getCount() > 0) { employeeInput.getForm().findField("TaxAccount_Identifica tionNo").setValue(store.getAt(0).data.IdentificationNo); employeeInput.getForm().findField("TaxAccount_CityId").s etValue(store.getAt(0).data.CityID); employeeInput.getForm().findField("TaxAccount_ProvinceSt ateName").setValue(store.getAt(0).data.ProvinceStateName); employeeInput.getForm().findField("TaxAccount_CityName") .setValue(store.getAt(0).data.CityName); } isBankAccountandTaxInfoTabShowed = true; isEmployeeTaxAccountDataStoreLoaded = true; if (_isInsertMode) { employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeTaxAccountDataStore', model: 'EmployeeIdentificationModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Family Data Store" employeeFamilyDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx?opr=1010', reader: { type: 'json', root: 'EmployeeNextOfKin', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNextOfKinID', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, isLoaded: function () { return this.loaded; },

listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isEmployeeFamilyDataStoreLoaded = true; isFamilyStructuresTabShowed = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this }, 'datachanged': { fn: function (store, options) { var i=0; var dependencyCount=0; for(i=0;i<employeeFamilyDataStore.getCount();i++) { if(employeeFamilyDataStore.getAt(i).data.isPPHfactor) dependencyCount++; } employeeInput.getForm().findField("TaxStatus_DependencyCount ").setValue(dependencyCount); }, scope: this } }, pageSize: 50, storeId: 'employeeFamilyDataStore', model: 'EmployeeNextOfKinModel', waitMsg: 'Loading...' }); //#endregion //#region "Create SMS Forwarding Data Store" employeeReportingToSMSDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeReportingToSMS', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: {

field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isSMSForwardingToTabShowed = true; isEmployeeReportingToSMSDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } if (_isAddSMSForwardingToFromCurrentReportingTo) { guid = new GUID(); guid.NewId(); var newEmployeeReportingToSMS = Ext.ModelManager.create( { Id: guid.Id, ReportSMSEmployeeNo: _SelectedEmployee.EmployeeN o, ReportingToName: (_SelectedEmployee.FirstName + ' ' + _SelectedEmployee.LastName) }, 'EmployeeReportingToSMSModel' ); employeeReportingToSMSDataStore.insert(0, newEmployeeRep ortingToSMS); _isAddSMSForwardingToFromCurrentReportingTo = false; } }, scope: this } }, pageSize: 50, storeId: 'employeeReportingToSMSDataStore', model: 'EmployeeReportingToSMSModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Internal Working History Data Store" employeeInternalWorkDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx',

reader: { type: 'json', root: 'EmployeeInternalWork', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isInternalWorkingHistoryTabShowed = true; isEmployeeInternalWorkDataStoreLoaded = true; if (_isAddInternalWorkFromCurrentEmployment) { var currentTime = new Date() var month = currentTime.getMonth() + 1 var day = currentTime.getDate() var year = currentTime.getFullYear() guid = new GUID(); guid.NewId(); var newInternalWorkingHistory = Ext.ModelManager.create( { Id: guid.Id, EmployeeNo: topEmployeeForm.getForm().findFi eld("EmployeeNoDisplay").getValue(), StartDate: year + '-' + month + '-' + day, //EndDate: year + '-' + month + '-' + day, DepartmentID: employeeInput.getForm().findFi eld("DepartmentID").getValue(), EmploymentTransferID: 0, OfficeLocationID: employeeInput.getForm().fi ndField("OfficeLocationID").getValue(), EmploymentStatusID: employeeInput.getForm(). findField("EmploymentStatusID").getValue(), JobTitleID: employeeInput.getForm().findFiel d("JobTitleID").getValue(), ReportingTo: employeeInput.getForm().findFie ld("ReportingTo").getValue(), DepartmentName: employeeInput.getForm().find Field("DepartmentName").getValue(), DivisionName: employeeInput.getForm().findFi eld("DivisionName").getValue(), GroupName: employeeInput.getForm().findField ("GroupName").getValue(), EmploymentTransferName: '', OfficeLocationName: employeeInput.getForm(). findField("OfficeLocationName").getValue(), EmploymentStatusName: employeeInput.getForm( ).findField("EmploymentStatusID").getRawValue(),

JobTitleName: employeeInput.getForm().findFi eld("JobTitleID").getRawValue(), JobTitlePublish: employeeInput.getForm().fin dField("JobTitlePublish").getValue(), ReportingToName: employeeInput.getForm().fin dField("ReportingToName").getValue() }, 'EmployeeInternalWorkModel' ); employeeInternalWorkDataStore.insert(0, newInternalWorki ngHistory); selectedEmployeeInternalWorkRecord = employeeCertificate DataStore.getAt(0); ShowUpdateEmployeeInternalWorkForm(employeeInternalWorkD ataStore, newInternalWorkingHistory); _isAddInternalWorkFromCurrentEmployment = false; } if (_isInsertMode) { employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeInternalWorkDataStore', model: 'EmployeeInternalWorkModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Education Data Store" employeeEducationDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeEducation', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo',

direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isEducationalBackgroundTabShowed = true; isEmployeeEducationDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeEducationDataStore', model: 'EmployeeEducationModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Training Data Store" employeeTrainingDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeTraining', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) {

this.loaded = true; isTrainingsandSeminardsTabShowed = true; isEmployeeTrainingDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeTrainingDataStore', model: 'EmployeeTrainingModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Certificate Data Store" employeeCertificateDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeCertificate', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isProfesionalCertificatesTabShowed = true; isEmployeeCertificateDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false);

} //alert(_isAddCertificateFromCurrentExam); if (_isAddCertificateFromCurrentExam) { guid = new GUID(); guid.NewId(); var lastAddedCertificate = employeeExamDataStore.getAt(0 ).data; var newCertificate = Ext.ModelManager.create( { Id: guid.Id, TakenDate: lastAddedCertificate.TakenDate, ExpireDate: lastAddedCertificate.ExpireDate, CityID: lastAddedCertificate.CityID, CertificateIssuerID: lastAddedCertificate.Certif icateIssuerID, Grade: lastAddedCertificate.Grade, Score: lastAddedCertificate.Score, IsPassed: lastAddedCertificate.IsPassed, CertificateIssuerName: lastAddedCertificate.Cert ificateIssuerName, CityName: lastAddedCertificate.CityName, ProvinceStateName: lastAddedCertificate.Province StateName, CountryName: lastAddedCertificate.CountryName }, 'EmployeeCertificateModel' ); //employeeCertificateDataStore.insert(0, newCertificate) ; //selectedEmployeeCertificateRecord = employeeCertificat eDataStore.getAt(0); ShowAddEmployeeCertificateWithDefaultValueForm(employeeC ertificateDataStore, newCertificate); _isAddCertificateFromCurrentExam = false; } }, scope: this } }, pageSize: 50, storeId: 'employeeCertificateDataStore', model: 'EmployeeCertificateModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Exam Data Store" employeeExamDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload', 'add'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx',

reader: { type: 'json', root: 'EmployeeExam', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isProfesionalExamTabShowed = true; isEmployeeExamDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this }, 'add': { fn: function (store, records, index, options) { Ext.Msg.show({ title: 'Certification Confirmation', buttons: Ext.MessageBox.YESNO, msg: 'Do you want to record the certificate for this exa m?', fn: function (btn) { if (btn == 'yes') { if (!isProfesionalCertificatesTabShowed) { //alert('masuk fill'); _isAddCertificateFromCurrentExam = true; isProfesionalCertificatesTabShowed = true; FillData(15); } else { //alert('proses'); guid = new GUID(); guid.NewId(); var lastAddedCertificate = store.getAt(index ).data; var newCertificate = Ext.ModelManager.create ( { Id: guid.Id, TakenDate: lastAddedCertificate.Take

nDate, ExpireDate: lastAddedCertificate.Exp ireDate, CityID: lastAddedCertificate.CityID, CertificateIssuerID: lastAddedCertif icate.CertificateIssuerID, Grade: lastAddedCertificate.Grade, Score: lastAddedCertificate.Score, IsPassed: lastAddedCertificate.IsPas sed, CertificateIssuerName: lastAddedCert ificate.CertificateIssuerName, CityName: lastAddedCertificate.CityN ame, ProvinceStateName: lastAddedCertific ate.ProvinceStateName, CountryName: lastAddedCertificate.Co untryName }, 'EmployeeCertificateModel' ); //employeeCertificateDataStore.insert(0, new Certificate); //selectedEmployeeCertificateRecord = employ eeCertificateDataStore.getAt(0); ShowAddEmployeeCertificateWithDefaultValueFo rm(employeeCertificateDataStore, newCertificate); } } } }); }, scope: this } }, pageSize: 50, storeId: 'employeeExamDataStore', model: 'EmployeeExamModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Scholarship Data Store" employeeScholarshipDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeScholarship', totalProperty: 'totalCount' } }, sorters: [{

property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isScholarshipsTabShowed = true; isEmployeeScholarshipDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeScholarshipDataStore', model: 'EmployeeScholarshipModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee ExternalWork Data Store" employeeExternalWorkDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeExternalWork', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' },

isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isExternalWorkingHistoryTabShowed = true; isEmployeeExternalWorkDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeExternalWorkDataStore', model: 'EmployeeExternalWorkModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Organization Data Store" employeeOrganizationDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeOrganization', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isSocialandPoliticalActivitiesTabShowed = true;

isEmployeeOrganizationDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeOrganizationDataStore', model: 'EmployeeOrganizationModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee MilitaryConscript Data Store" employeeMilitaryConscriptDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeMilitaryConscript', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isMilitaryConscriptTabShowed = true; isEmployeeMilitaryConscriptDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } },

scope: this } }, pageSize: 50, storeId: 'employeeMilitaryConscriptDataStore', model: 'EmployeeMilitaryConscriptModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Award Data Store" employeeAwardDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeAward', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isNonScholarshipAwardsTabShowed = true; isEmployeeAwardDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeAwardDataStore', model: 'EmployeeAwardModel', waitMsg: 'Loading...' });

//#endregion //#region "Create Employee Language Data Store" employeeLanguageDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeLanguage', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isLanguageAbilityTabShowed = true; isEmployeeLanguageDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeLanguageDataStore', model: 'EmployeeLanguageModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Hobby Data Store" employeeHobbyDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this);

this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeHobby', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isHobbyTabShowed = true; isEmployeeHobbyDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeHobbyDataStore', model: 'EmployeeHobbyModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Health Data Store" employeeHealthDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeHealth',

totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isMedicalRecordsTabShowed = true; isEmployeeHealthDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeHealthDataStore', model: 'EmployeeHealthModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Reference Data Store" employeeReferenceDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeReference', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false,

sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; isReferenceDetailsTabShowed = true; isEmployeeReferenceDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeReferenceDataStore', model: 'EmployeeReferenceModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee QuestionTask Data Store" employeeQuestionTaskDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeQuestionTask', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNo', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: {

'load': { fn: function (store, records, options) { this.loaded = true; isQuestionnairesTabShowed = true; isEmployeeQuestionTaskDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeQuestionTaskDataStore', model: 'EmployeeQuestionTaskModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Address Type Data Store" addressStatusDataStore = Ext.create('Ext.data.Store', { autoload: false, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr=99911', reader: { Status: 'json', root: 'AddressStatusMaster', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'AddressStatusID', direction: 'ASC' }, pageSize: 50, storeId: 'addressStatusDataStore', model: 'AddressStatusModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Relationship Data Store" relationshipDataStore = Ext.create('Ext.data.Store', { autoload: true, proxy: { type: 'ajax', url: '../handler/LookupHandler.aspx?opr= 99912', reader: { type: 'json', root: 'RelationshipMaster', totalProperty: 'totalCount'

} }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: true, sortInfo: { field: 'RelationshipID', direction: 'ASC' }, pageSize: 50, storeId: 'relationshipDataStore', model: 'relationshipDataModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Employee Emergency Data Store" employeeEmergencyDataStore = Ext.create('Ext.data.Store', { autoload: false, loaded: false, initComponent: function () { this.superclass().initComponent.call(this); this.addEvents('load', 'beforeload'); }, proxy: { type: 'ajax', url: '../handler/HRISHandler.aspx', reader: { type: 'json', root: 'EmployeeNextOfKin', totalProperty: 'totalCount' } }, sorters: [{ property: 'lastpost', direction: 'DESC' }], remoteSort: false, sortInfo: { field: 'EmployeeNextOfKinID', direction: 'ASC' }, isLoaded: function () { return this.loaded; }, listeners: { 'load': { fn: function (store, records, options) { this.loaded = true; if (store.getCount() > 0) { var currentEmergencyContact = store.getAt(0).data; employeeInput.getForm().findField("EmergencyAddress_Firs tName").setValue(currentEmergencyContact.FirstName); employeeInput.getForm().findField("EmergencyAddress_Last Name").setValue(currentEmergencyContact.LastName); if (currentEmergencyContact.Gender) { employeeInput.getForm().findField("EmergencyAddress_

Gender").setValue('1'); } else { employeeInput.getForm().findField("EmergencyAddress_ Gender").setValue('0'); } relationshipDataStore.load({ callback: function () { relationshipComboBox = employeeInput.getForm().f indField("EmergencyAddress_RelationshipId"); relationshipComboBox.setValue(currentEmergencyCo ntact.RelationshipID); relationshipComboBox.fireEvent("select"); } }); } isEmergencyAddressTabShowed = true; isEmployeeEmergencyDataStoreLoaded = true; if (_isInsertMode){ employeeWindow.setLoading(!CheckAllDataStoreLoaded()); } else { employeeWindow.setLoading(false); } }, scope: this } }, pageSize: 50, storeId: 'employeeEmergencyDataStore', model: 'EmployeeNextOfKinModel', waitMsg: 'Loading...' }); //#endregion //#region "Create Project Detail Form" employeeForm = new Ext.create('Ext.form.Panel', { //#region "Basic Settings" //title: 'Inner Tabs', id: 'employeeForm', name: 'employeeForm', bodyStyle: 'padding:5px; background-color: #ffffff;', width: '100%', frame: false, border: false, //#endregion //#region "Default Settings" fieldDefaults: { labelAlign: 'left', labelWidth: 140, msgTarget: 'side' }, defaults: { anchor: '100%' }, //#endregion //#region "Clear All DataStore" ClearDataStores: function () { employeeWindow.setDisabled(true);

selectedEmployeeScholarshipRecord = undefined; selectedEmployeeAddressRecord = undefined; selectedEmployeeContactRecord = undefined; selectedEmployeeNextOfKinRecord = undefined; selectedEmployeeReportingToSMSRecord = undefined; selectedEmployeeInternalWorkRecord = undefined; selectedEmployeeEducationRecord = undefined; selectedEmployeeTrainingRecord = undefined; selectedEmployeeCertificateRecord = undefined; selectedEmployeeExternalWorkRecord = undefined; selectedEmployeeOrganizationRecord = undefined; selectedEmployeeMilitaryConscriptRecord = undefined; selectedEmployeeAwardRecord = undefined; selectedEmployeeHobbyRecord = undefined; selectedEmployeeHealthRecord = undefined; selectedEmployeeReferenceRecord = undefined; selectedEmployeeQuestionTaskRecord = undefined; selectedEmployeeExamRecord = undefined; employeeContactDataStore.removeAll(); employeeContactDataStore.fireEvent('datachanged'); employeeAddressDataStore.removeAll(); employeeAddressDataStore.fireEvent('datachanged'); employeeEmergencyAddressDataStore.removeAll(); employeeEmergencyAddressDataStore.fireEvent('datachanged'); employeeIdentificationDataStore.removeAll(); employeeIdentificationDataStore.fireEvent('datachanged'); employeeBankAccountDataStore.removeAll(); employeeBankAccountDataStore.fireEvent('datachanged'); employeeTaxAccountDataStore.removeAll(); employeeTaxAccountDataStore.fireEvent('datachanged'); employeeFamilyDataStore.removeAll(); employeeFamilyDataStore.fireEvent('datachanged'); employeeReportingToSMSDataStore.removeAll(); employeeReportingToSMSDataStore.fireEvent('datachanged'); employeeInternalWorkDataStore.removeAll(); employeeInternalWorkDataStore.fireEvent('datachanged'); employeeEducationDataStore.removeAll(); employeeEducationDataStore.fireEvent('datachanged'); employeeTrainingDataStore.removeAll(); employeeTrainingDataStore.fireEvent('datachanged'); employeeCertificateDataStore.removeAll(); employeeCertificateDataStore.fireEvent('datachanged'); employeeExamDataStore.removeAll(); employeeExamDataStore.fireEvent('datachanged'); employeeScholarshipDataStore.removeAll(); employeeScholarshipDataStore.fireEvent('datachanged'); employeeExternalWorkDataStore.removeAll(); employeeExternalWorkDataStore.fireEvent('datachanged'); employeeOrganizationDataStore.removeAll(); employeeOrganizationDataStore.fireEvent('datachanged'); employeeMilitaryConscriptDataStore.removeAll(); employeeMilitaryConscriptDataStore.fireEvent('datachanged'); employeeAwardDataStore.removeAll(); employeeAwardDataStore.fireEvent('datachanged'); employeeLanguageDataStore.removeAll(); employeeLanguageDataStore.fireEvent('datachanged'); employeeHobbyDataStore.removeAll(); employeeHobbyDataStore.fireEvent('datachanged');

employeeHealthDataStore.removeAll(); employeeHealthDataStore.fireEvent('datachanged'); employeeReferenceDataStore.removeAll(); employeeReferenceDataStore.fireEvent('datachanged'); employeeQuestionTaskDataStore.removeAll(); employeeQuestionTaskDataStore.fireEvent('datachanged'); employeeWindow.setDisabled(false); }, //#endregion //#region "Update City Data Lookup" UpdateCityMaster: function () { switch (__SelectedLastField) { case 'BirthCityID': employeeForm.getForm().findField("BirthCityName").setValue(_ SelectedCityMaster.CityName); employeeForm.getForm().findField("BirthCityID").setValue(_Se lectedCityMaster.CityID); employeeForm.getForm().findField("BirthProvinceStateName").s etValue(_SelectedCityMaster.ProvinceStateName); employeeForm.getForm().findField("BirthCountryName").setValu e(_SelectedCityMaster.CountryName); break; case 'EmergencyAddress_CityID': employeeForm.getForm().findField("EmergencyAddress_CityName" ).setValue(_SelectedCityMaster.CityName); employeeForm.getForm().findField("EmergencyAddress_CityID"). setValue(_SelectedCityMaster.CityID); employeeForm.getForm().findField("EmergencyAddress_ProvinceS tateName").setValue(_SelectedCityMaster.ProvinceStateName); employeeForm.getForm().findField("EmergencyAddress_CountryNa me").setValue(_SelectedCityMaster.CountryName); break; case 'TaxAccount_CityId': employeeForm.getForm().findField("TaxAccount_CityId").setVal ue(_SelectedCityMaster.CityID); employeeForm.getForm().findField("TaxAccount_CityName").setV alue(_SelectedCityMaster.CityName); employeeForm.getForm().findField("TaxAccount_ProvinceStateNa me").setValue(_SelectedCityMaster.ProvinceStateName); break; case 'BankAccount_CityId': employeeForm.getForm().findField("BankAccount_CityId").setVa lue(_SelectedCityMaster.CityID); employeeForm.getForm().findField("BankAccount_CityName").set Value(_SelectedCityMaster.CityName); employeeForm.getForm().findField("BankAccount_ProvinceStateN ame").setValue(_SelectedCityMaster.ProvinceStateName); break; } }, //#endregion //#region "Update Nationality Data Lookup" UpdateCountryMaster: function () { switch (__SelectedLastField) { case 'NationalityCountryID': employeeForm.getForm().findField("NationalityCountryName").s etValue(_SelectedCountryMaster.NationalityName); employeeForm.getForm().findField("NationalityCountryID").set

Value(_SelectedCountryMaster.CountryID); break; } }, //#endregion //#region "Update Department Data Lookup" UpdateDepartmentMaster: function () { switch (__SelectedLastField) { case 'DepartmentID': employeeForm.getForm().findField("DepartmentID").setValue(_S electedDepartmentMaster.DepartmentID); employeeForm.getForm().findField("DepartmentName").setValue( _SelectedDepartmentMaster.DepartmentName); employeeForm.getForm().findField("GroupName").setValue(_Sele ctedDepartmentMaster.GroupName); employeeForm.getForm().findField("DivisionName").setValue(_S electedDepartmentMaster.DivisionName); break; } }, //#endregion //#region "Update OfficeLocation Data Lookup" UpdateOfficeLocationMaster: function () { switch (__SelectedLastField) { case 'OfficeLocationID': employeeForm.getForm().findField("OfficeLocationID").setValu e(_SelectedOfficeLocationMaster.OfficeLocationID); employeeForm.getForm().findField("OfficeLocationName").setVa lue(_SelectedOfficeLocationMaster.OfficeLocationName); break; } }, //#endregion //#region "Update Employee Data Lookup" UpdateEmployee: function () { switch (__SelectedLastField) { case 'ReportingTo': employeeForm.getForm().findField("ReportingTo").setValue(_Se lectedEmployee.EmployeeNo); employeeForm.getForm().findField("ReportingToName").setValue (_SelectedEmployee.FirstName + ' ' + _SelectedEmployee.LastName); Ext.Msg.show({ title: 'SMS Reporting Confirmation', buttons: Ext.MessageBox.YESNO, msg: 'Add "' + _SelectedEmployee.FirstName + ' ' + _Sele ctedEmployee.LastName + '" as SMS Forwarding To?', fn: function (btn) { if (btn == 'yes') { if (!isSMSForwardingToTabShowed) { _isAddSMSForwardingToFromCurrentReportingTo = true; isSMSForwardingToTabShowed = true; FillData(9); } else { guid = new GUID(); guid.NewId();

var newEmployeeReportingToSMS = Ext.ModelMan ager.create( { Id: guid.Id, ReportSMSEmployeeNo: _SelectedEmploy ee.EmployeeNo, ReportingToName: (_SelectedEmployee. FirstName + ' ' + _SelectedEmployee.LastName) }, 'EmployeeReportingToSMSModel' ); employeeReportingToSMSDataStore.insert(0, ne wEmployeeReportingToSMS); } } } }); break; } }, //#endregion items: [ //#region "Employee Basic Fields" /* { layout: 'column', border: false, items: [ { columnWidth: .12, border: false, layout: 'anchor', items: [ { xtype:'box', id:'EmployeePictureImage', autoEl:{ style:'border: solid 1px #EFEFEF;height:113px;width:85px;padding:10px 10 px 0px 10px;border:1px;', tag:'img', src:'../Image/EmployeePhoto/sample.jpg', onclick: "" } }, { xtype: 'filefield', id: 'employeePhoto-path', //emptyText: 'Select an image', //fieldLabel: 'Photo', autoEl:{ style:'padding:0px 0px 20px 10px;' }, name: 'employeePhoto-path', buttonOnly: true, hideLabel: true, buttonText: 'Change' //,

//buttonConfig: { // iconCls: 'upload-icon' //}, } ] }, { columnWidth: .88, border: false, layout: 'anchor', defaults: { allowBlank: true, readOnly: true, labelAlign: 'left', labelWidth: 80, disabled: true, //anchor: '70%' width: 400 }, defaultType: 'textfield', items: [ { xtype: 'displayfield', value: '&nbsp;' }, { fieldLabel: 'NIK', name: 'EmployeeNoDisplay', width: 200, readOnly: false, disabled: false }, { fieldLabel: 'First Name', name: 'FirstNameDisplay' }, { fieldLabel: 'Last Name', name: 'LastNameDisplay' } ] } ] },*/ //#endregion //#region "Employee Tab" { xtype: 'tabpanel', id: 'employeeDetailForm', name: 'employeeDetailForm', plain: true, height: 420, width: '100%', defaults: { bodyStyle: 'padding:10px' }, items: [ //#region "General Personal Details Tab" { title: 'General Personal Details', defaults: { width: '100%' }, height: '100%',

width: '100%', defaultType: 'textfield', id: 'generalPersonalDetailsTabItem', items: [{ xtype: 'tabpanel', id: 'generalPersonalDetailsPanel', plain: true, height: '100%', width: '100%', defaults: { bodyStyle: 'padding:10px' }, items: [ //#region "Personal Details Tab" { title: 'Personal Details', layout: 'column', border: false, id: 'personalDetailsTabItem', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isPersonalDetailsTabShowed) { isPersonalDetailsTabShowed = tru e; if (_SelectedEmployeeRecord != u ndefined) FillData(1); } } }, scope: this } }, items: [ { columnWidth: .5, border: false, layout: 'anchor', defaultType: 'textfield', defaults: { labelAlign: 'left', anchor: '95%' }, items: [ { xtype: 'combo', mode: 'local', triggerAction: 'all', forceSelection: true, editable: false, fieldLabel: 'Salutation', name: 'SalutationName', displayField: 'name', valueField: 'name', queryMode: 'local', width: 200, store: Ext.create('Ext.data. Store', { fields: ['name', 'value'

], data: [ { name: 'Mr.', value : 'Mr.' }, { name: 'Mrs.', valu e: 'Mrs.' }, { name: 'Miss.', val ue: 'Miss.' } ] }) }, { fieldLabel: 'First Name', name: 'FirstName', listeners: { 'change': { fn: function () { topEmployeeForm. getForm().findField("FirstNameDisplay").setValue(employeeInput.getForm().findFie ld("FirstName").getValue()); }, scope: this } } }, { fieldLabel: 'Last Name', name: 'LastName', listeners: { 'change': { fn: function () { topEmployeeForm. getForm().findField("LastNameDisplay").setValue(employeeInput.getForm().findFiel d("LastName").getValue()); }, scope: this } } }, { fieldLabel: 'Nick Name', name: 'NickName' }, { xtype: 'radiogroup', fieldLabel: 'Gender', anchor: '70%', name: 'Gender_RadioGroup', items: [ { boxLabel: 'Male', name : 'Gender', inputValue: '1' }, { boxLabel: 'Female', na me: 'Gender', inputValue: '0' } ] }, { fieldLabel: 'Blood Type', name: 'BloodTypeID', xtype: 'combobox', displayField: 'BloodTypeName

', store: bloodTypeDataStore, typeAhead: true, valueField: 'BloodTypeID' }, { fieldLabel: 'Religion', xtype: 'combobox', name: 'ReligionID', //allowBlank: true, id: 'ReligionID', displayField: 'ReligionName' , store: religionDataStore, typeAhead: true, valueField: 'ReligionID' }, { xtype: 'fieldcontainer', fieldLabel: 'Height', layout: 'hbox', combineErrors: false, defaults: { hideLabel: true }, items: [ { name: 'Height', xtype: 'numberfield' , width: 48, labelAlign: 'left', allowBlank: true }, { xtype: 'displayfield ', value: '&nbsp;Cm(s)& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;Weight : ', width: 160 }, { name: 'Weight', xtype: 'numberfield' , width: 48, allowBlank: true }, { xtype: 'displayfield ', value: '&nbsp;Kg(s)' } ] } ] }, { columnWidth: .5,

border: false, layout: 'anchor', defaults: { labelAlign: 'left', anchor: '95%' }, items: [ { fieldLabel: 'Birth Date', name: 'BirthDate', xtype: 'datefield', //width: 200, labelAlign: 'left', format: 'd/m/Y'//, //renderer: Ext.util.Format. dateRenderer('d/m/Y') }, { xtype: 'fieldcontainer', fieldLabel: 'Birth City', layout: 'hbox', labelAlign: 'left', combineErrors: false, defaults: { hideLabel: true }, items: [ { name: 'BirthCityName ', xtype: 'textfield', width: 272, labelAlign: 'left', readOnly: true }, { xtype: 'button', id: 'employeeBirthCi tyButton', name: 'employeeBirth CityButton', width: 17, iconCls: 'grid-searc h-icon', handler: (function ( ) { __SelectedLastFi eld = 'BirthCityID'; __SelectedPartia lForm = employeeForm; ShowCityMasterLo okup(employeeForm, 'BirthCityID'); }) }, { name: 'BirthCityID', xtype: 'hidden', width: 50, labelAlign: 'left' }

] }, { name: 'BirthProvinceStateNam e', xtype: 'textfield', fieldLabel: 'Province/State' , //disabled: true, labelStyle: 'color:grey;', readOnly: true }, { name: 'BirthCountryName', xtype: 'textfield', fieldLabel: 'Country', //disabled: true, labelStyle: 'color:grey;', readOnly: true }, { fieldLabel: 'Ethnicity', xtype: 'combobox', name: 'EtnicID', //allowBlank: true, id: 'EtnicID', displayField: 'EtnicName', store: etnicDataStore, typeAhead: true, valueField: 'EtnicID' }, { xtype: 'fieldcontainer', fieldLabel: 'Nationality', layout: 'hbox', labelAlign: 'left', combineErrors: false, defaults: { hideLabel: true }, items: [ { name: 'NationalityCo untryName', xtype: 'textfield', width: 272, labelAlign: 'left', readOnly: true, isDisabled: true }, { xtype: 'button', id: 'employeeNationa lityCountryButton', width: 17, iconCls: 'grid-searc h-icon', handler: (function ( ) { __SelectedLastFi

eld = 'NationalityCountryID'; __SelectedPartia lForm = employeeForm; ShowCountryMaste rLookup(employeeForm, 'NationalityCountryID'); }) }, { name: 'NationalityCo untryID', xtype: 'hidden', width: 50, labelAlign: 'left' } ] }, { fieldLabel: 'Marital Status' , xtype: 'combobox', name: 'MaritalStatusID', id: 'MaritalStatusIDEmployee ', displayField: 'MaritalStatus Name', store: maritalStatusDataStor e, typeAhead: true, valueField: 'MaritalStatusID ', listeners: { select: function (combo, record, index) { var selectedCombo = employeeForm.getForm().findField("MaritalStatusID"); var v = selectedComb o.getValue(); sDataStore.findRecord(selectedCombo.valueField ; == '0') { //employeeInput. getForm().findField("MaritalStatusIDEmployee").setDisabled(true); employeeInput.ge tForm().findField("MarriageDate").setDisabled(true); employeeInput.ge tForm().findField("TaxStatus_MaritalStatus").setValue("TK"); } else { //employeeInput. getForm().findField("MaritalStatusIDEmployee").setDisabled(false); employeeInput.ge tForm().findField("MarriageDate").setDisabled(false); employeeInput.ge tForm().findField("TaxStatus_MaritalStatus").setValue("K"); } } } }, { var r = maritalStatu selectedCombo.displayField, v) if (r.data.IsMarital

fieldLabel: 'Marriage Date', name: 'MarriageDate', xtype: 'datefield', format: 'd/m/Y', disabled: true } ] } ] }, //#endregion //#region "Contact Details Tab" { title: 'Contact Details', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isContactDetailsTabShowed) { isContactDetailsTabShowed = true ; FillData(2); } } } } }, items: CreateEmployeeContactGrid(employeeContactData Store) }, //#endregion //#region "Addresses Tab" { title: 'Addresses', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isAddressesTabShowed) { isAddressesTabShowed = true; FillData(3); } } } } }, items: CreateEmployeeAddressGrid(employeeAddressData Store) }, //#endregion //#region "Emergency Address Tab" { title: 'Emergency Address',

layout: 'column', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isEmergencyAddressTabShowed) { isEmergencyAddressTabShowed = tr ue; FillData(4); } } } } }, items: [ { columnWidth: .5, border: false, layout: 'anchor', defaultType: 'textfield', defaults: { anchor: '95%', labelAlign: 'left' }, items: [ { xtype: 'displayfield', value: '<b>Emergency Locatio n</b>', width: 160 }, { fieldLabel: '&nbsp;&nbsp;&nb sp;Address Status', xtype: 'combobox', name: 'EmergencyAddress_Addr essStatus', id: 'EmergencyAddress_Addres sStatus', allowBlank: true, displayField: 'AddressStatus Name', store: addressStatusDataStor e, typeAhead: true, valueField: 'AddressStatusID ' }, { fieldLabel: '&nbsp;&nbsp;&nb sp;Address', name: 'EmergencyAddress_Addr essName' }, { fieldLabel: '&nbsp;&nbsp;&nb sp;RT', name: 'EmergencyAddress_RTCo de' },

{ fieldLabel: '&nbsp;&nbsp;&nb sp;RW', name: 'EmergencyAddress_RWCo de' }, { fieldLabel: '&nbsp;&nbsp;&nb sp;Kelurahan', name: 'EmergencyAddress_Kelu rahanName' }, { fieldLabel: '&nbsp;&nbsp;&nb sp;Kecamatan', name: 'EmergencyAddress_Keca matanName' }, { xtype: 'fieldcontainer', fieldLabel: '&nbsp;&nbsp;&nb sp;City', layout: 'hbox', labelAlign: 'left', combineErrors: false, defaults: { hideLabel: true }, items: [ { name: 'EmergencyAddr ess_CityName', xtype: 'textfield', width: 272, labelAlign: 'left', readOnly: true }, { xtype: 'button', id: 'EmergencyAddres s_CityButton', width: 17, handler: (function ( ) { __SelectedLastFi eld = 'EmergencyAddress_CityID'; __SelectedPartia lForm = employeeForm; ShowCityMasterLo okup(employeeForm, 'EmergencyAddress_CityID'); }), iconCls: 'grid-searc h-icon' }, { name: 'EmergencyAddr ess_CityID', xtype: 'hidden', width: 50, labelAlign: 'left'

} ] }, { fieldLabel: '&nbsp;&nbsp;&nb sp;Province / State', name: 'EmergencyAddress_Prov inceStateName', labelStyle: 'color:grey;', readOnly: true }, { fieldLabel: '&nbsp;&nbsp;&nb sp;Country', name: 'EmergencyAddress_Coun tryName', labelStyle: 'color:grey;', readOnly: true }, { fieldLabel: '&nbsp;&nbsp;&nb sp;Postal Code', name: 'EmergencyAddress_Post alCode' }, { fieldLabel: '&nbsp;&nbsp;&nb sp;Fax', name: 'EmergencyAddress_FaxN umber' } ] }, { columnWidth: .5, border: false, layout: 'anchor', defaultType: 'textfield', defaults: { anchor: '95%', labelAlign: 'left' }, items: [ { xtype: 'displayfield', value: '<b>Emergency Contact </b>', width: 160 }, { fieldLabel: '&nbsp;&nbsp;&nb sp;First Name', name: 'EmergencyAddress_Firs tName' }, { fieldLabel: '&nbsp;&nbsp;&nb sp;Last Name', name: 'EmergencyAddress_Last Name'

}, { fieldLabel: '&nbsp;&nbsp;&nb sp;Relationship', xtype: 'combobox', name: 'EmergencyAddress_Rela tionshipId', id: 'EmergencyAddress_Relati onshipId', allowBlank: true, displayField: 'RelationshipN ame', store: relationshipDataStore , typeAhead: true, valueField: 'RelationshipID' }, { xtype: 'radiogroup', fieldLabel: '&nbsp;&nbsp;&nb sp;Gender', anchor: '70%', name: 'EmergencyAddress_Gend er_RadioGroup', items: [ { boxLabel: 'Male', name : 'EmergencyAddress_Gender', inputValue: '1' }, { boxLabel: 'Female', na me: 'EmergencyAddress_Gender', inputValue: '0' } ] }, { fieldLabel: '&nbsp;&nbsp;&nb sp;Contact No', name: 'EmergencyAddress_Cont actNo', emptyText: 'Use ", " as sepa rator for multiple contact no' } ] } ] }, //#endregion //#region "Identity Cards Tab" { title: 'Identity Cards', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isIdentityCardsTabShowed) { isIdentityCardsTabShowed = true; FillData(5); } } }

} }, items: CreateEmployeeIdentificationGrid(employeeIden tificationDataStore) } //#endregion ] }] }, //#endregion //#region "Family Structures Tab" { title: 'Family Structures', layout: 'anchor', id: 'familyStructuresPanel', width: '100%', height: '100%', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isFamilyStructuresTabShowed) { isFamilyStructuresTabShowed = true; FillData(6); } } } } }, items: CreateEmployeeFamilyGrid(employeeFamilyDataStore) }, //#endregion //#region "Employment Details Tab" { title: 'Employment Details', defaults: { width: '100%' }, height: '100%', width: '100%', defaultType: 'textfield', id: 'employmentDetailsTabItem', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isEmploymentStatusTabShowed) { isEmploymentStatusTabShowed = true; FillData(7); } } } } }, items: [ { xtype: 'tabpanel', plain: true, height: '100%', width: '100%',

id: 'employmentDetailsPanel', defaults: { bodyStyle: 'padding:10px' }, items: [ //#region "Employment Status Tab" { title: 'Employment Status', //defaultType: 'textfield', layout: 'column', id: 'employmentStatusTabItem', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isEmploymentStatusTabSh owed) { isEmploymentStatusTabSho wed = true; FillData(7); } } } } }, items: [ { columnWidth: .5, border: false, layout: 'anchor', defaultType: 'textfield', defaults: { anchor: '95%', labelAlign: 'left' }, items: [ { fieldLabel: 'Job Title', name: 'JobTitleID', xtype: 'combobox', id: 'JobTitleID', displayField: 'JobTitleN ame', store: jobTitleDataStore , typeAhead: true, valueField: 'JobTitleID' , listeners: { select: function (co mbo, record, index) { var selectedComb o = employeeForm.getForm().findField("JobTitleID"); var fieldJobTitl ePublish = employeeForm.getForm().findField("JobTitlePublish").getValue(); var v = selected Combo.getRawValue(); if (fieldJobTitl ePublish == '') { employeeInpu t.getForm().findField("JobTitlePublish").setValue(v);

} } } }, { fieldLabel: 'Job Title i n Name Card', name: 'JobTitlePublish' }, { fieldLabel: 'Group', name: 'GroupName', readOnly: true, labelStyle: 'color:grey; ' }, { fieldLabel: 'Division', name: 'DivisionName', readOnly: true, labelStyle: 'color:grey; ' }, { xtype: 'fieldcontainer', fieldLabel: 'Department' , layout: 'hbox', labelAlign: 'left', combineErrors: false, defaults: { hideLabel: true }, items: [ { name: 'Departmen tName', xtype: 'textfiel d', width: 272, labelAlign: 'lef t', readOnly: true }, { xtype: 'button', width: 17, iconCls: 'grid-search-icon', id: 'Employee_DepartmentButton', handler: (function () { __SelectedLastField = 'DepartmentID';

__SelectedPartialForm = employeeForm; ShowDepartmentMasterLookup(employeeForm, 'DepartmentID'); }) }, { name: 'Department ID', xtype: 'textfield ', width: 50, labelAlign: 'left ', hidden: true } ] }, { xtype: 'fieldcontainer', fieldLabel: 'Office', layout: 'hbox', labelAlign: 'left', combineErrors: false, defaults: { hideLabel: true }, items: [ { name: 'OfficeLoc ationName', xtype: 'textfiel d', width: 272, labelAlign: 'lef t', readOnly: true }, { xtype: 'button', width: 17, id: 'Employee_OfficeLocationButton', iconCls: 'grid-search-icon', handler: (function () { __SelectedLastField = 'OfficeLocationID'; __SelectedPartialForm = employeeForm; ShowOfficeLocationLookup(employeeForm, 'OfficeLocationID'); })

}, { name: 'OfficeLocationID', xtype: 'textfield', width: 50, labelAlign: 'left', hidden: true } ] } ] }, { columnWidth: .5, border: false, layout: 'anchor', defaultType: 'textfield', defaults: { labelAlign: 'left', anchor: '95%' }, items: [ { fieldLabel: 'Employment Status', name: 'EmploymentStatusI D', xtype: 'combobox', id: 'EmploymentStatusIDE mployee', displayField: 'Employmen tStatusName', store: employmentStatusD ataStore, typeAhead: true, valueField: 'EmploymentS tatusID', listeners: { select: function (co mbo, record, index) { var selectedComb o = employeeForm.getForm().findField("EmploymentStatusID"); var v = selected Combo.getValue(); ntStatusDataStore.findRecord(selectedCombo.valueField eld, v); ign == '0') { //employeeIn put.getForm().findField("MaritalStatusIDEmployee").setDisabled(true); employeeInpu t.getForm().findField("ReasonToResignID").setDisabled(true); employeeInpu var r = employme selectedCombo.displayFi if (r.data.IsRes

t.getForm().findField("ResignDate").setDisabled(true); } else { //employeeIn put.getForm().findField("MaritalStatusIDEmployee").setDisabled(false); employeeInpu t.getForm().findField("ReasonToResignID").setDisabled(false); employeeInpu t.getForm().findField("ResignDate").setDisabled(false); } } } }, { fieldLabel: 'Job Level', name: 'JobLevelID', xtype: 'combobox', id: 'JobLevelIDEmployee' , displayField: 'JobLevelN ame', store: jobLevelDataStore , typeAhead: true, valueField: 'JobLevelID' }, { fieldLabel: 'Job Grade', name: 'JobGradeID', xtype: 'combobox', id: 'JobGradeIDEmployee' , displayField: 'JobGradeN ame', store: jobGradeDataStore , typeAhead: true, valueField: 'JobGradeID' }, { fieldLabel: 'Join Date', name: 'JoinDate', xtype: 'datefield', format: 'd/m/Y'//, }, { xtype: 'fieldcontainer', fieldLabel: 'Supervisor' , layout: 'hbox', combineErrors: false, defaults: { hideLabel: true }, items: [ { name: 'Reporting To', xtype: 'textfiel d',

width: 70, labelAlign: 'lef t', allowBlank: true , hidden: true }, { name: 'Reporting ToName', xtype: 'textfiel d', width: 272, labelAlign: 'lef t', readOnly: true, isDisabled: true , allowBlank: true }, { xtype: 'button', width: 17, id: 'Employee_ReportingToButton', iconCls: 'grid-search-icon', handler: (function () { __SelectedLastField = 'ReportingTo'; __SelectedPartialForm = employeeForm; ShowEmployeeLookup(employeeForm, 'ReportingTo'); }) } ] }, { fieldLabel: 'Active Dire ctory', name: 'ActiveDirectory' }, { xtype: 'displayfield', value: '&nbsp;' }, { xtype: 'fieldcontainer', fieldLabel: '&nbsp;', labelStyle: 'color:white ;', layout: 'hbox', combineErrors: false, defaults: {

hideLabel: true }, items: [ { xtype: 'button', text: '&nbsp;&nb sp;Add Current Employment into Internal Working History&nbsp;', id: 'AddToIntern alWorkingHistory', handler: (functi on () { AddInternalW orkingHistory(); }) } ] } ] } ] }, //#endregion //#region "Resignation Note Tab" { title: 'Resignation Note', layout: 'column', border: false, listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isResignationNoteTabShowed) { isResignationNoteTabShowed = true; FillData(8); } } } } }, items: [ { columnWidth: .5, border: false, layout: 'anchor', defaultType: 'textfield', defaults: { labelAlign: 'left', anchor: '95%' }, items: [ { fieldLabel: 'Resign Date ', name: 'ResignDate', xtype: 'datefield', format: 'd/m/Y',

disabled: true } ] }, { columnWidth: .5, border: false, layout: 'anchor', defaultType: 'textfield', defaults: { labelAlign: 'left', anchor: '95%' }, items: [ { fieldLabel: 'Reason to R esign', name: 'ReasonToResignID' , xtype: 'combobox', id: 'ReasonToResignIDEmp loyee', displayField: 'ReasonToR esignName', store: reasonToResignDat aStore, typeAhead: true, valueField: 'ReasonToRes ignID', disabled: true/*, listeners: { select: function (co mbo, record, index) { var selectedComb oReasonToResign = employeeForm.getForm().findField("ReasonToResignIDEmployee"); var valv = selec tedComboReasonToResign.getValue(); var valr = reaso nToResignDataStore.findRecord(selectedComboReasonToResign.valueField selected ComboReasonToResign.displayField, valv); if (valr.data.Is Resign == '0') { employeeInpu t.getForm().findField("ResignDate").setDisabled(true); } else { employeeInpu t.getForm().findField("ResignDate").setDisabled(false); } } }*/ }] } ] }, //#endregion //#region "SMS Forwarding To Tab" { title: 'SMS Forwarding To', defaultType: 'textfield',

layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isSMSForwardingToTabShowed) { isSMSForwardingToTabShowed = true; FillData(9); } } } } }, items: CreateEmployeeReportingToSMSGrid(employee ReportingToSMSDataStore) }, //#endregion //#region "Internal Working History Tab" { title: 'Internal Working History', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isInternalWorkingHistoryTab Showed) { isInternalWorkingHistoryTabS howed = true; FillData(10); } } } } }, items: CreateEmployeeInternalWorkGrid(employeeIn ternalWorkDataStore) } //#endregion ] } ] }, //#endregion //#region "Financial Details Tab" { title: 'Financial Details', defaults: { width: '100%' }, height: '100%', width: '100%', defaultType: 'textfield', id: 'financialDetailsTabItem', listeners: { 'activate': { fn: function (tab, eOpts) {

if (__IsBackgroundProcess) { if (!isSalaryandBenefitsTabShowed) { isSalaryandBenefitsTabShowed = true; FillData(11); } } } } }, items: [ { xtype: 'tabpanel', plain: true, height: '100%', width: '100%', id: 'financialDetailsPanel', defaults: { bodyStyle: 'padding:10px' }, items: [ //#region "Salary and Benefits Tab" { title: 'Salary and Benefits', id: 'salaryAndBenefitsTabItem', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isSalaryandBenefitsTabShowe d) { isSalaryandBenefitsTabShowed = true; FillData(11); } } } } }, //defaultType: 'textfield', border: false, layout: 'column', items: [ { columnWidth: 1, border: false, layout: 'anchor', defaultType: 'textfield', defaults: { labelWidth: 250, anchor: '100%', labelAlign: 'left' }, items: [ { xtype: 'fieldcontain er', fieldLabel: 'Last Ma in Salary', layout: 'hbox', labelAlign: 'left',

combineErrors: false , defaults: { hideLabel: true }, items: [ { fieldLabel: 'Last Main Salary Currency', name: 'LastM ainSalaryCurrency', xtype: 'comb obox', displayField : 'CURRENCYCODE', store: lastM ainSalaryCurrencyDataStore, typeAhead: t rue, valueField: 'CURRENCYCODE', width: 50 }, { xtype: 'disp layfield', value: '&nbs p;', width: 10 }, { xtype: 'numb erfield', width: 575, fieldLabel: 'Last Main Salary Amount', name: 'LastM ainSalaryAmount' } ] }, { xtype: 'fieldcontain er', fieldLabel: 'Last An nual Bonus', layout: 'hbox', labelAlign: 'left', combineErrors: false , defaults: { hideLabel: true }, items: [ { name: 'LastA nnualBonusCurrency', xtype: 'comb obox', displayField

: 'CURRENCYCODE', store: lastA nnualBonusCurrencyDataStore, typeAhead: t rue, valueField: 'CURRENCYCODE', width: 50 }, { xtype: 'disp layfield', value: '&nbs p;', width: 10 }, { xtype: 'numb erfield', width: 575, fieldLabel: 'Last Annual Bonus Amount', name: 'LastA nnualBonusAmount' } ] }, { xtype: 'fieldcontain er', fieldLabel: 'Last Pe rformance Bonus', layout: 'hbox', labelAlign: 'left', combineErrors: false , defaults: { hideLabel: true }, items: [ { name: 'LastP erformanceBonusCurrency', xtype: 'comb obox', displayField : 'CURRENCYCODE', store: lastP erformanceBonusCurrencyDataStore, typeAhead: t rue, valueField: 'CURRENCYCODE', width: 50 }, { xtype: 'disp layfield', value: '&nbs p;',

width: 10 }, { xtype: 'numb erfield', width: 575, fieldLabel: 'Last Performance Bonus Amount', name: 'LastP erformanceBonusAmount' } ] }, { xtype: 'fieldcontain er', fieldLabel: 'Last Be nefits', layout: 'hbox', labelAlign: 'left', combineErrors: false , defaults: { hideLabel: true }, items: [ { fieldLabel: 'Last Benefits Currency', name: 'LastB enefitsCurrency', xtype: 'comb obox', displayField : 'CURRENCYCODE', store: lastB enefitsCurrencyDataStore, typeAhead: t rue, valueField: 'CURRENCYCODE', width: 50 }, { xtype: 'disp layfield', value: '&nbs p;', width: 10 }, { xtype: 'numb erfield', width: 575, fieldLabel: 'Last Benefits Amount', name: 'LastB enefitsAmount' } ]

}, { xtype: 'fieldcontain er', fieldLabel: 'Expecte d Salary', layout: 'hbox', labelAlign: 'left', combineErrors: false , defaults: { hideLabel: true }, items: [ { fieldLabel: 'Expected Salary Currency', name: 'Expec tedSalaryCurrency', xtype: 'comb obox', displayField : 'CURRENCYCODE', store: expec tedSalaryCurrencyDataStore, typeAhead: t rue, valueField: 'CURRENCYCODE', width: 50 }, { xtype: 'disp layfield', value: '&nbs p;', width: 10 }, { xtype: 'numb erfield', width: 575, fieldLabel: 'Expected Salary Amount', name: 'Expec tedSalaryAmount' } ] }, ] }, { columnWidth: .5, border: false, layout: 'anchor', defaults: { labelWidth: 250, anchor: '95%', labelAlign: 'left' },

items: [ { fieldLabel: 'NoticeP eriod', name: 'NoticePeriod' , xtype: 'datefield', format: 'd/m/Y' } ] } ] }, //#endregion //#region "Bank Account and Tax Info Tab" { title: 'Bank Account and Tax Info', //defaultType: 'textfield', layout: 'column', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isBankAccountandTaxInfoTabS howed) { isBankAccountandTaxInfoTabSh owed = true; FillData(12); } } } } }, items: [ { columnWidth: .5, border: false, layout: 'anchor', defaultType: 'textfield', defaults: { anchor: '95%', labelAlign: 'left' }, items: [ { fieldLabel: 'BCA Account ', name: 'BankAccount_Ident ificationNo' }, { xtype: 'fieldcontainer', fieldLabel: 'City BCA Ac count', layout: 'hbox', combineErrors: false, defaults: { hideLabel: true },

items: [ { name: 'BankAccou nt_CityId', xtype: 'textfiel d', width: 70, labelAlign: 'lef t', allowBlank: true , hidden: true }, { name: 'BankAccou nt_CityName', xtype: 'textfiel d', width: 272, labelAlign: 'lef t', allowBlank: true , readOnly: true }, { xtype: 'button', width: 17, id: 'BankAccount_CityButton', iconCls: 'grid-search-icon', handler: (function () { __SelectedLastField = 'BankAccount_CityId'; __SelectedPartialForm = employeeForm; ShowCityMasterLookup(employeeForm, 'BankAccount_CityId'); }) } ] }, { fieldLabel: 'Province Ba nk Account', name: 'BankAccount_Provi nceStateName', labelStyle: 'color:grey; ', readOnly: true//, //disabled: true }, ] },

{ columnWidth: .5, border: false, layout: 'anchor', defaultType: 'textfield', defaults: { anchor: '95%', labelAlign: 'left' }, items: [ { fieldLabel: 'Tax Account ', name: 'TaxAccount_Identi ficationNo' }, { xtype: 'fieldcontainer', fieldLabel: 'City Tax Ac count', layout: 'hbox', combineErrors: false, defaults: { hideLabel: true }, items: [ { name: 'TaxAccoun t_CityId', xtype: 'textfiel d', width: 70, labelAlign: 'lef t', allowBlank: true , hidden: true }, { name: 'TaxAccoun t_CityName', xtype: 'textfiel d', width: 272, labelAlign: 'lef t', allowBlank: true , readOnly: true }, { xtype: 'button', width: 17, id: 'TaxAccount_CityButton', iconCls: 'grid-search-icon',

handler: (function () { __SelectedLastField = 'TaxAccount_CityId'; __SelectedPartialForm = employeeForm; ShowCityMasterLookup(employeeForm, 'TaxAccount_CityId'); }) } ] }, { fieldLabel: 'Province Ta x Account', name: 'TaxAccount_Provin ceStateName', labelStyle: 'color:grey; ', readOnly: true//, //disabled: true }, { xtype: 'displayfield', value: '' }, { xtype: 'fieldcontainer', fieldLabel: 'Tax Status' , layout: 'hbox', labelAlign: 'left', labelStyle: 'color:grey; ', combineErrors: false, //disabled: true, defaults: { hideLabel: true, readOnly: true //disabled: true }, items: [ { name: 'TaxStatus _MaritalStatus', xtype: 'textfiel d', width: 48, labelAlign: 'lef t', readOnly: true }, { xtype: 'displayfield', value: '&nbsp;&nbsp; /',

width: 30 }, { name: 'TaxStatus_DependencyCount', xtype: 'textfield', width: 48, readOnly: true

} ] } ] } ] } //#endregion ] } ] }, //#endregion //#region "Education Tab" { title: 'Education', defaultType: 'textfield', height: '100%', width: '100%', defaults: { width: '100%' }, id: 'educationTabItem', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isEducationalBackgroundTabShowed) { isEducationalBackgroundTabShowed = true; FillData(13); } } } } }, items: [ { xtype: 'tabpanel', plain: true, height: '100%', width: '100%', id: 'educationPanel', defaults: { bodyStyle: 'padding:10px' },

items: [ //#region "Educational Background Tab" { title: 'Educational Background', defaultType: 'textfield', layout: 'anchor', id: 'educationalBackgroundTabItem', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isEducationalBackgroundTabS howed) { isEducationalBackgroundTabSh owed = true; FillData(13); } } } } }, items: CreateEmployeeEducationGrid(employeeEduca tionDataStore) }, //#endregion //#region "Trainings and Seminars Tab" { title: 'Trainings and Seminars', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isTrainingsandSeminardsTabS howed) { isTrainingsandSeminardsTabSh owed = true; FillData(14); } } } } }, items: CreateEmployeeTrainingGrid(employeeTraini ngDataStore) }, //#endregion //#region "Profesional Certificates Tab" { title: 'Professional Certificates', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) {

if (!isProfesionalCertificatesTa bShowed) { isProfesionalCertificatesTab Showed = true; FillData(15); } } } } }, items: CreateEmployeeCertificateGrid(employeeCer tificateDataStore) }, //#endregion //#region "Profesional Exam Tab" { title: 'Professional Exams', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isProfesionalExamTabShowed) { isProfesionalExamTabShowed = true; FillData(16); } } } } }, items: CreateEmployeeExamGrid(employeeExamDataSt ore) }, //#endregion //#region "Scholarships Tab" { title: 'Scholarships', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isScholarshipsTabShowed) { isScholarshipsTabShowed = tr ue; FillData(17); } } } } }, items: CreateEmployeeScholarshipGrid(employeeSch olarshipDataStore) }

//#endregion ] } ] }, //#endregion //#region "Experiences Tab" { title: 'Experiences', defaultType: 'textfield', height: '100%', width: '100%', defaults: { width: '100%' }, id: 'experiencesTabItem', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isExternalWorkingHistoryTabShowed) { isExternalWorkingHistoryTabShowed = true; FillData(18); } } } } }, items: [ { xtype: 'tabpanel', plain: true, height: '100%', width: '100%', id: 'experiencesPanel', defaults: { bodyStyle: 'padding:10px' }, items: [ //#region "External Working History Tab" { title: 'External Working History', defaultType: 'textfield', layout: 'anchor', id: 'externalWorkingHistoryTabItem', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isExternalWorkingHistoryTab Showed) { isExternalWorkingHistoryTabS howed = true; FillData(18); } } } } }, items: CreateEmployeeExternalWorkGrid(employeeEx ternalWorkDataStore) },

//#endregion //#region "Social and Political Activities Tab" { title: 'Social and Political Activities', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isSocialandPoliticalAct ivitiesTabShowed) { isSocialandPoliticalActi vitiesTabShowed = true; FillData(19); } } } } }, items: CreateEmployeeOrganizationGrid(employ eeOrganizationDataStore) }, //#endregion //#region "Military Conscript Tab" { title: 'Military Conscript', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isMilitaryConscriptTabS howed) { isMilitaryConscriptTabSh owed = true; FillData(20); } } } } }, items: CreateEmployeeMilitaryConscriptGrid(e mployeeMilitaryConscriptDataStore) }, //#endregion //#region "Non-Scholarship Awards Tab" { title: 'Non-Scholarship Awards', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isNonScholarshipAwardsT

abShowed) { isNonScholarshipAwardsTa bShowed = true; FillData(21); } } } } }, items: CreateEmployeeAwardGrid(employeeAward DataStore) } //#endregion ] } ] }, //#endregion //#region "Additional Information Tab" { title: 'Additional Information', defaultType: 'textfield', defaults: { width: '100%' }, height: '100%', width: '100%', id: 'additionalInformationTabItem', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isLanguageAbilityTabShowed) { isLanguageAbilityTabShowed = true; FillData(22); } } } } }, items: [ { xtype: 'tabpanel', plain: true, height: '100%', width: '100%', id: 'additionalInformationPanel', defaults: { bodyStyle: 'padding:10px' }, items: [ //#region "Language Ability Tab" { title: 'Language Ability', defaultType: 'textfield', layout: 'anchor', id: 'languageAbilityTabItem', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) {

if (!isLanguageAbilityTabShowed) { isLanguageAbilityTabShowed = true; FillData(22); } } } } }, items: CreateEmployeeLanguageGrid(employeeLangua geDataStore) }, //#endregion //#region "Hobby Tab" { title: 'Hobby', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isHobbyTabShowed) { isHobbyTabShowed = true; FillData(23); } } } } }, items: CreateEmployeeHobbyGrid(employeeHobbyData Store) }, //#endregion //#region "Medical Records Tab" { title: 'Medical Records', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isMedicalRecordsTabShow ed) { isMedicalRecordsTabShowe d = true; FillData(24); } } } } }, items: CreateEmployeeHealthGrid(employeeHeal thDataStore) }, //#endregion

//#region "Reference Details Tab" { title: 'Reference Details', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isReferenceDetailsTabSh owed) { isReferenceDetailsTabSho wed = true; FillData(25); } } } } }, items: CreateEmployeeReferenceGrid(employeeR eferenceDataStore) }, //#endregion //#region "Questionnaires Tab" { title: 'Questionnaires', defaultType: 'textfield', layout: 'anchor', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isQuestionnairesTabShow ed) { isQuestionnairesTabShowe d = true; FillData(26); } } } } }, items: CreateEmployeeQuestionTaskGrid(employ eeQuestionTaskDataStore) }, //#endregion //#region "Miscellaneous Info Tab" { title: 'Miscellaneous Info', //defaultType: 'textfield', border: false, layout: 'column', listeners: { 'activate': { fn: function (tab, eOpts) { if (__IsBackgroundProcess) { if (!isMiscellaneousInfoTabS

howed) { isMiscellaneousInfoTabSh owed = true; FillData(27); } } } } }, items: [ { columnWidth: .3, border: false, layout: 'anchor', /*defaultType: 'textfield', defaults: { labelAlign: 'left', anchor: '95%' },*/ items: [ { xtype: 'radiogroup', fieldLabel: 'Is Willing To Travel', labelAlign: 'left', //name: 'IsWillingToTrav el', name: 'IsWillingToTravel _RadioGroup', labelWidth: 150, items: [ { boxLabel: 'No', na me: 'IsWillingToTravel', inputValue: '0' }, { boxLabel: 'Yes', n ame: 'IsWillingToTravel', inputValue: '1'} //, checked: true} ] }, { xtype: 'radiogroup', fieldLabel: 'Is Willing To Relocated', //name: 'IsWillingToRelo cated', name: 'IsWillingToReloca ted_RadioGroup', labelAlign: 'left', labelWidth: 150, items: [ { boxLabel: 'No', na me: 'IsWillingToRelocated', inputValue: '0' }, { boxLabel: 'Yes', n ame: 'IsWillingToRelocated', inputValue: '1'} //, checked: true} ] } ] }, { columnWidth: 1, border: false, layout: 'anchor',

defaultType: 'textfield', defaults: { labelAlign: 'left', anchor: '95%' }, items: [ { fieldLabel: 'Work Source ', name: 'WorkSourceID', xtype: 'combobox', labelWidth: 150, width: '200px', id: 'WorkSourceIDEmploye e', displayField: 'WorkSourc eName', store: workSourceDataSto re, typeAhead: true, valueField: 'WorkSourceI D', labelAlign: 'left' }, { fieldLabel: 'Reason To J oin', xtype: 'textarea', name: 'ReasonToJoin', labelWidth: 150, defaultType: 'text field ', height: 60, labelAlign: 'left' }, { fieldLabel: 'Other Consi deration', xtype: 'textarea', name: 'OtherConsideratio n', labelWidth: 150, height: 60, labelAlign: 'left' }, { fieldLabel: 'Career Obje ctives', xtype: 'textarea', name: 'CareerObjectives' , labelWidth: 150, height: 60, labelAlign: 'left' } ] } ] } //#endregion

] } ] } //#endregion ] } //#endregion ] }); //#endregion return employeeForm; } //#endregion

You might also like