/*Strat OnDocAfterRender */ /* End OnDocAfterRender */ /* Start OnDocBefore Submit */ /* End OnDocBefore Submit */ /* start OnInitExtension */ 'field[name=AppraisalPeriod_47]': { expand: function () { debugger periodMap(); }, select: function () { setDefaultAppraiser(); setPeriod(); } },'button[name=PHRPA0048ESSAdd]': { click: function () { debugger ValRowAppraiser(); } },'field[name=AppraisalD_48]': { change: function () { fillNameAppr (); } } /* End OnInitExtension */ /* Start OnMethodExtension */ function periodMap() { var AppraisalType = Ext.ComponentQuery.query('[name=AppraisalType_47]')[0].getValue(); var store = Ext.StoreManager.lookup('storeAppraisalPeriod_47'); store.removeAll(); MinovaUtil.ExecuteParamQuery({ ID: "WFGOALPARAMPERIOD", EmployeeID: MinovaUtil.WORKFLOW.getEmpId(), AppraisalType: AppraisalType }, function (s) { var result = Ext.decode(s.responseText); Dt = Ext.decode(Ext.decode(result.data)); store.loadData(Dt); }, function (f) {}); } function setDefaultAppraiser() { var gridStore = Ext.StoreManager.lookup('storePHRPA0048ESS'); MinovaUtil.ExecuteParamQuery({ ID: 'WFPMSDEFAULTAPPRG', empid_requester: MinovaUtil.WORKFLOW.getEmpId(), now: MinovaUtil.GetNowDate() }, function (s) { try { var result = Ext.decode(s.responseText).data; var dataGrid = Ext.decode(Ext.decode(result)); gridStore.loadData(dataGrid); } catch (e) {} }, function (e) {}); setDefaultQUAL(); } function setDefaultQUAL() { var gridStore = Ext.StoreManager.lookup('storePHRPA0051ESS'); MinovaUtil.ExecuteParamQuery({ ID: 'WFPMSDEFAULTQUALG', empid_requester: MinovaUtil.WORKFLOW.getEmpId(), now: MinovaUtil.GetNowDate() }, function (s) { try { var result = Ext.decode(s.responseText).data; var dataGrid = Ext.decode(Ext.decode(result)); gridStore.loadData(dataGrid); } catch (e) {} }, function (e) {}); } function setPeriod() { var AppraisalType = Ext.ComponentQuery.query('[name=AppraisalType_47]')[0].getValue(); var AppraisalPeriod = Ext.ComponentQuery.query('[name=AppraisalPeriod_47]')[0].getValue(); Ext.Ajax.request({ async: false, method: 'POST', url: '/UserControl/GetStore', params: { tableName: 'PCMAPPPERIOD', param: 'Isactive[=]1,Apptype[=]' + AppraisalType + ',code[=]' + AppraisalPeriod }, success: function (response) { var results = Ext.decode(response.responseText); Ext.ComponentQuery.query('[name=StartDate_47]')[0].setValue(results.data[0].Startdate); Ext.ComponentQuery.query('[name=EndDate_47]')[0].setValue(results.data[0].Enddate); } }); } function ValRowAppraiser() { var body = MinovaUtil.WORKFLOW.getViewBodyWorkflow(); var gridStore = Ext.StoreManager.lookup('storePHRPA0048ESS'); if (gridStore.data.length >= 6 ) { gridStore.removeAt(idx); Ext.Msg.alert('Alert', 'Sorry, Value cannot > 6'); } } function fillNameAppr() { var AppraisalID = Ext.ComponentQuery.query('[name=AppraisalD_48]')[0].getValue(); var store = Ext.StoreManager.lookup('storePHRPA0048ESS'); MinovaUtil.ExecuteParamQuery({ ID: "WFGOALAPPFILLNAME", appID: AppraisalID, now: MinovaUtil.GetNowDate() }, function (s) { var result = Ext.decode(s.responseText); Dt = Ext.decode(Ext.decode(result.data)); var appName = Ext.ComponentQuery.query('[name=Appraisername_48]')[0]; appName.setValue(Dt[0].Appraisername_48); }, function (f) {}); } /* End OnMethodExtension */