fix infiniteScroll

master
ashwaq 6 years ago
parent 1d9652ca4c
commit 8a4ab39623

@ -121,7 +121,7 @@ export class HomeComponent implements OnInit {
this.absService.getAbsenceList(request).subscribe(
(result: any) => {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetWorkList)) {
if (this.common.hasData(result.GetAbsenceTransactionList)) {
this.P_PAGE_NUM++;
result.GetAbsenceTransactionList.forEach(vr => {
if (vr.ROW_NUM == vr.NO_OF_ROWS) {

@ -103,7 +103,7 @@ export class HomeComponent implements OnInit {
if (this.cs.validResponse(result)) {
if (this.cs.hasData(result.GetEmployeeSubordinatesList)) {
this.empSubordinate = result.GetEmployeeSubordinatesList;
this.pageNum++;
this.infiniteRequest.P_PAGE_NUM= this.pageNum++;
let lastItemIndex = this.empSubordinate.length - 1;
if (result.GetEmployeeSubordinatesList[lastItemIndex]) {
let lastitem = result.GetEmployeeSubordinatesList[lastItemIndex];
@ -121,12 +121,14 @@ export class HomeComponent implements OnInit {
doInfinite(infiniteScroll) {
if (!this.IsReachEnd && this.infiniteRequest) {
this.infiniteRequest.P_PAGE_NUM = this.pageNum;
// this.infiniteRequest.P_PAGE_NUM = this.pageNum;
this.myTeamService.getEmployeeSubordinates(this.infiniteRequest).
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
this.pageNum++;
if (this.cs.hasData(result.GetWorkList)) {
// this.pageNum++;
this.infiniteRequest.P_PAGE_NUM= this.pageNum++;
if (this.cs.hasData(result.GetEmployeeSubordinatesList)) {
result.GetEmployeeSubordinatesList.forEach(vr => {
if (vr.ROW_NUM == vr.NO_OF_ROWS) {
this.IsReachEnd = true;

@ -168,7 +168,8 @@ export class DetailsComponent implements OnInit {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
this.empSubordinate = result.GetEmployeeSubordinatesList;
this.pageNum++;
// this.pageNum++;
this.infiniteRequest.P_PAGE_NUM= this.pageNum++;
let lastItemIndex = this.empSubordinate.length - 1;
if (result.GetEmployeeSubordinatesList[lastItemIndex]) {
let lastitem = result.GetEmployeeSubordinatesList[lastItemIndex];
@ -185,14 +186,15 @@ export class DetailsComponent implements OnInit {
}
doInfinite(infiniteScroll) {
if (!this.IsReachEnd && this.infiniteRequest) {
this.infiniteRequest.P_PAGE_NUM = this.pageNum;
// this.infiniteRequest.P_PAGE_NUM = this.pageNum;
this.myTeamService
.getEmployeeSubordinates(this.infiniteRequest)
.subscribe(
(result: any) => {
if (this.common.validResponse(result)) {
this.pageNum++;
if (this.common.hasData(result.GetWorkList)) {
this.infiniteRequest.P_PAGE_NUM= this.pageNum++;
if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
result.GetEmployeeSubordinatesList.forEach(vr => {
if (vr.ROW_NUM == vr.NO_OF_ROWS) {
this.IsReachEnd = true;

@ -56,6 +56,7 @@ export class HomeComponent implements OnInit {
if (!this.isSearch) this.getEmpSubordinate();
}
getEmpSubordinate() {
console.log("getEmpSubordinate my team home");
this.pageNum = 1;
this.IsReachEnd = false;
let searchEmpNum = "";

@ -20,7 +20,7 @@ export class ItemHistoryComponent implements OnInit {
itemHistoryRes: any;
IsReachEnd: boolean = false;
P_PAGE_NUM: number = 1;
P_PAGE_LIMIT: number = 100;
P_PAGE_LIMIT: number = 50;
POItemHistoryReq:any;
getPassItemHistoreyList: any;
constructor(
@ -63,6 +63,7 @@ export class ItemHistoryComponent implements OnInit {
if (this.cs.hasData(result.GetPoItemHistoryList)) {
this.itemHistoryRes = result.GetPoItemHistoryList;
this.P_PAGE_NUM++;
this.POItemHistoryReq.P_PAGE_NUM = this.P_PAGE_NUM;
let lastItemIndex = this.itemHistoryRes.length - 1;
if (result.GetPoItemHistoryList[lastItemIndex]) {
let lastitem = result.GetPoItemHistoryList[lastItemIndex];
@ -84,7 +85,7 @@ export class ItemHistoryComponent implements OnInit {
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
if (result.GetPoItemHistoryList != undefined) {
this.P_PAGE_NUM++;
this.POItemHistoryReq.P_PAGE_NUM=this.P_PAGE_NUM++;
(result.GetPoItemHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;

@ -25,6 +25,7 @@ export class QutationAnalysisComponent implements OnInit {
getPassPOHeaderID: any;
getPassItemHistoreyList: any;
getQutationAnalysis:any;
doInfiniteReq: any;
constructor(public worklistMainService: WorklistMainService,
private cs: CommonService,
private ts: TranslatorService,
@ -59,8 +60,9 @@ console.log("getPassPOItemID: "+this.getPassPOHeaderID);
const request = new QuotationAnalysisRequest();
request.P_ITEM_ID=parseInt(itemID);
request.P_PO_HEADER_ID=headerID;
request.P_PAGE_LIMIT=100;
request.P_PAGE_NUM=1;
request.P_PAGE_LIMIT=1;
request.P_PAGE_NUM=50;
this.doInfiniteReq=request;
this.worklistMainService.getQutationAnalysis(request).
subscribe((result: QuotationAnalysisResponse) => {
this.handleQutationAnalysisResult(result);
@ -75,7 +77,7 @@ console.log("getPassPOItemID: "+this.getPassPOHeaderID);
//set sheard data
//
this.getQutationAnalysis = result.GetQuotationAnalysisList;
this.P_PAGE_NUM++;
this.doInfiniteReq.P_PAGE_NUM++;
let lastItemIndex = this.getQutationAnalysis.length - 1;
if (result.GetQuotationAnalysisList[lastItemIndex]) {
let lastitem = result.GetQuotationAnalysisList[lastItemIndex];
@ -93,12 +95,13 @@ console.log("getPassPOItemID: "+this.getPassPOHeaderID);
doInfinite(infiniteScroll) {
if (!this.IsReachEnd) {
this.getQutationAnalysis.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistMainService.getQutationAnalysis(this.getQutationAnalysis).
// this.getQutationAnalysis.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistMainService.getQutationAnalysis(this.doInfiniteReq).
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
if (result.GetQuotationAnalysisList != undefined) {
this.P_PAGE_NUM++;
this.doInfiniteReq.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetQuotationAnalysisList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;

@ -46,7 +46,8 @@ export class WorkListActionHistoryComponent implements OnInit {
if (this.cs.validResponse(result)) {
if (this.cs.hasData(result.GetActionHistoryList)) {
this.actionHistoryRes = result.GetActionHistoryList;
this.P_PAGE_NUM++;
// this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM++;
let lastItemIndex = this.actionHistoryRes.length - 1;
if (result.GetActionHistoryList[lastItemIndex]) {
let lastitem = result.GetActionHistoryList[lastItemIndex];
@ -75,12 +76,14 @@ export class WorkListActionHistoryComponent implements OnInit {
doInfinite(infiniteScroll) {
if (!this.IsReachEnd) {
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
// this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;

@ -665,6 +665,7 @@ export class WorklistMainMRComponent implements OnInit {
if (this.common.hasData(result.GetActionHistoryList)) {
this.actionHistoryRes = result.GetActionHistoryList;
this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
let lastItemIndex = this.actionHistoryRes.length - 1;
if (result.GetActionHistoryList[lastItemIndex]) {
let lastitem = result.GetActionHistoryList[lastItemIndex];
@ -700,12 +701,13 @@ export class WorklistMainMRComponent implements OnInit {
console.log("doInfinite action history MR");
if (!this.IsReachEnd) {
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
@ -783,12 +785,12 @@ export class WorklistMainMRComponent implements OnInit {
doInfiniteNotificationBody(infiniteScroll) {
console.log("doInfiniteNotificationBody MR");
if (!this.IsReachEnd) {
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistMainService.getMONotificationBody(this.WorkListActionHistoryObj).
subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.GetMoNotificationBodyList != undefined) {
this.P_PAGE_NUM++;
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetMoNotificationBodyList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
@ -820,12 +822,13 @@ export class WorklistMainMRComponent implements OnInit {
if (!this.IsReachEnd) {
console.log("this.IsReachEnd"+ this.IsReachEnd);
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistMainService.getMONotificationBody(this.WorkListBodyObj).
subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.GetMoNotificationBodyList != undefined) {
this.P_PAGE_NUM++;
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetMoNotificationBodyList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
@ -855,12 +858,13 @@ export class WorklistMainMRComponent implements OnInit {
console.log("doInfinite action history MR");
if (!this.IsReachEnd) {
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;

@ -690,6 +690,7 @@ export class WorklistMainPoComponent implements OnInit {
if (this.common.hasData(result.GetActionHistoryList)) {
this.actionHistoryRes = result.GetActionHistoryList;
this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
let lastItemIndex = this.actionHistoryRes.length - 1;
if (result.GetActionHistoryList[lastItemIndex]) {
let lastitem = result.GetActionHistoryList[lastItemIndex];
@ -724,12 +725,13 @@ export class WorklistMainPoComponent implements OnInit {
doInfinite(infiniteScroll) {
console.log("doInfinite action history");
if (!this.IsReachEnd) {
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
@ -867,12 +869,12 @@ export class WorklistMainPoComponent implements OnInit {
if (!this.IsReachEnd) {
console.log("this.IsReachEnd"+ this.IsReachEnd);
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistMainService.getPONotificationBody(this.WorkListBodyObj).
subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.GetPoNotificationBodyList != undefined) {
this.P_PAGE_NUM++;
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetPoNotificationBodyList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
@ -898,17 +900,17 @@ export class WorklistMainPoComponent implements OnInit {
// infiniteScroll.target.complete();
}
}//end infiniteScroll
loadMoreActionHistory() {
console.log("doInfinite action history MR");
if (!this.IsReachEnd) {
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;

@ -810,12 +810,13 @@ export class WorklistMainPRComponent implements OnInit {
if (!this.IsReachEnd) {
console.log("this.IsReachEnd" + this.IsReachEnd);
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistMainService.getPRNotificationBody(this.WorkListBodyObj).
subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.GetPrNotificationBodyList != undefined) {
this.P_PAGE_NUM++;
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetPrNotificationBodyList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
@ -845,12 +846,12 @@ export class WorklistMainPRComponent implements OnInit {
console.log("doInfinite action history MR");
if (!this.IsReachEnd) {
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;

@ -30,6 +30,9 @@ export class HomeComponent implements OnInit {
defultSelected: any;
IsReachEnd: any;
private deductionReq: DeductionRequest;
doinfiniteDedReq:any;
doinfinitEarReq:any;
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
constructor(
@ -85,7 +88,6 @@ export class HomeComponent implements OnInit {
// P_PAGE_NUM: this.P_PAGE_NUM,
// P_PAGE_LIMIT: this.P_PAGE_LIMIT
};
this.payslipService.getPayslip(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{
this.handleRespondGetPayslipResult(result);
@ -227,10 +229,10 @@ getDeduction(ActionContextID){
//this.pageNum= this.pageNum + 1;
if (!this.IsReachEnd) {
this.payslipService.getDeduction(this.deductionReq).subscribe(
this.payslipService.getDeduction(this.doinfiniteReq).subscribe(
(result: any) => {
if (this.common.validResponse(result)) {
this.deductionReq.P_PAGE_NUM++;
this.doinfiniteReq.P_PAGE_NUM++;
if (this.common.hasData(result.GetDeductionsList)) {
result.GetDeductionsList.forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {

@ -37,7 +37,7 @@ export class HomeComponent implements OnInit {
constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, private router: Router) {
this.P_PAGE_NUM = 1;
this.P_PAGE_LIMIT = 100;
this.P_PAGE_LIMIT = 1;
//this.button = new ButtonInput('btnSubmit', 'Submit', 'containerDiv', 'Y');
// this.dateTime = new DateTimeInput('Start Date', 'SDate', '', 'containerDiv', 'Y', 'Y', 'Y');
@ -98,6 +98,7 @@ export class HomeComponent implements OnInit {
}, this.ts.trPK('general', 'retry')).subscribe((result) => {
if (this.cs.validResponse(result)) {
this.GetVacationRulesList = result.GetVacationRulesList;
this.P_PAGE_NUM++;
} else {
this.cs.presentAlert(result.ErrorEndUserMessage);
}
@ -168,13 +169,14 @@ export class HomeComponent implements OnInit {
let request: VacationRuleRequest = new VacationRuleRequest();
request.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
request.P_PAGE_NUM = this.P_PAGE_NUM;
if (!this.IsReachEnd) {
this.vacationRuleService.getVacationRule(request, () => {
// this.getVacationRules();
}, this.ts.trPK('general', 'retry')).subscribe((result) => {
if (this.cs.validResponse(result)) {
request.P_PAGE_NUM++;
this.P_PAGE_NUM++;
request.P_PAGE_NUM = this.P_PAGE_NUM;
if (this.cs.hasData(result.GetVacationRulesList)) {
result.GetVacationRulesList.forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {

Loading…
Cancel
Save