filterctrl

This commit is contained in:
venbatechnologies@gmail.com 2021-12-19 08:14:39 +05:30
parent af814f1b0d
commit 32e47445c6
2 changed files with 12 additions and 8 deletions

View File

@ -132,7 +132,7 @@
<mat-form-field> <mat-form-field>
<mat-select placeholder="Bank Name" formControlName="bank_name"> <mat-select placeholder="Bank Name" formControlName="bank_name">
<mat-option> <mat-option>
<ngx-mat-select-search [formControl]="bankFilterCtrl" <ngx-mat-select-search [formControl]="filterCtrl"
[placeholderLabel]="'Search Bank...'" [placeholderLabel]="'Search Bank...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search> [noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option> </mat-option>
@ -291,7 +291,7 @@
<mat-form-field> <mat-form-field>
<mat-select placeholder="Bank Name" formControlName="bank_name_business"> <mat-select placeholder="Bank Name" formControlName="bank_name_business">
<mat-option> <mat-option>
<ngx-mat-select-search [formControl]="bankFilterCtrl" <ngx-mat-select-search [formControl]="filterCtrl"
[placeholderLabel]="'Search Bank...'" [placeholderLabel]="'Search Bank...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search> [noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option> </mat-option>

View File

@ -56,7 +56,7 @@ export class BankingDetailsComponent implements OnInit {
image_doc_params: { pdid: number; form_id: any; company_id: string; }; image_doc_params: { pdid: number; form_id: any; company_id: string; };
form_id: string; form_id: string;
public bankFilterCtrl:FormControl = new FormControl(); public filterCtrl:FormControl = new FormControl();
public filtered_m_btLenderList:ReplaySubject<any> = new ReplaySubject<any>(1); public filtered_m_btLenderList:ReplaySubject<any> = new ReplaySubject<any>(1);
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
@ -178,6 +178,7 @@ export class BankingDetailsComponent implements OnInit {
// control.push(this.createBankarray()); // control.push(this.createBankarray());
} else { } else {
result.forEach((datas, index) => { result.forEach((datas, index) => {
datas.filterCtrl=''
// this.selectedBorrower(datas.applicant_name,index); // this.selectedBorrower(datas.applicant_name,index);
this.selectedAccTypeChanges(+datas.account_type, index) this.selectedAccTypeChanges(+datas.account_type, index)
// this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi); // this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
@ -193,9 +194,10 @@ export class BankingDetailsComponent implements OnInit {
if (result1.length == 0) { if (result1.length == 0) {
// control.push(this.createBankarray()); // control.push(this.createBankarray());
} else { } else {
result1.forEach((datas, index) => { result1.forEach((datas1, index) => {
datas1.filterCtrl=''
// this.selectedBorrower(datas.applicant_name,index); // this.selectedBorrower(datas.applicant_name,index);
this.selectedAccTypeChanges1(+datas.account_type_business, index) this.selectedAccTypeChanges1(+datas1.account_type_business, index)
// this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi); // this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
//control.push(this.createBankarray()); //control.push(this.createBankarray());
control1.push(this.createBusinessarray()); control1.push(this.createBusinessarray());
@ -215,8 +217,8 @@ export class BankingDetailsComponent implements OnInit {
this.filterList(); this.filterList();
} }
filterList() { filterList() {
this.bankFilterCtrl.valueChanges.pipe().subscribe(()=>{ this.filterCtrl.valueChanges.pipe().subscribe(()=>{
this.applyFilter(this.bankFilterCtrl.value,this.filtered_m_btLenderList,this.m_btLenderList,'lender_name') this.applyFilter(this.filterCtrl.value,this.filtered_m_btLenderList,this.m_btLenderList,'lender_name')
}) })
} }
@ -263,6 +265,7 @@ export class BankingDetailsComponent implements OnInit {
this.bankingForm = this.fb.group({ this.bankingForm = this.fb.group({
banking_form_remark: [''], banking_form_remark: [''],
bank_info_available:[''], bank_info_available:[''],
bank_info_available_business:[''], bank_info_available_business:[''],
itemRows: this.fb.array([]), itemRows: this.fb.array([]),
itemRows1: this.fb.array([]), itemRows1: this.fb.array([]),
@ -283,7 +286,7 @@ export class BankingDetailsComponent implements OnInit {
bank_name: [''], bank_name: [''],
other_bank: [''], other_bank: [''],
account_type: [''], account_type: [''],
filterCtrl:[''],
//salary: [''], //salary: [''],
salary: this.pd_cus_segment.substring(0, 2) == 'SE' ? [''] : [''], salary: this.pd_cus_segment.substring(0, 2) == 'SE' ? [''] : [''],
limit: [''], limit: [''],
@ -304,6 +307,7 @@ export class BankingDetailsComponent implements OnInit {
bank_name_business: [''], bank_name_business: [''],
other_bank_business: [''], other_bank_business: [''],
account_type_business: [''], account_type_business: [''],
filterCtrl:[''],
//salary: [''], //salary: [''],
salary_business: this.pd_cus_segment.substring(0, 2) == 'SE' ? [''] : [''], salary_business: this.pd_cus_segment.substring(0, 2) == 'SE' ? [''] : [''],
limit_business: [''], limit_business: [''],