Open Closed

[hidden] with p-autocomplete #7812


0
sophoana created

Hi support

Cannot show p-autocomplete in [hidden].

I'm use: -angular 7 -asp.net core

image.png

  • this code:

                        <div class="form-group col-md-6">                             <label for="CustomerSaleCode">{{"CustomerSaleCode" | localize}}</label>                                                         <p-autoComplete                                 id="SingleSelectSaleCodeInput"                                 name="SingleSelectSaleCodeInput"                                 field="name"                                 [(ngModel)]="chartOfAccountSaleCode"                                  [suggestions]="filteredChartOfAccountSaleCode"                                 (completeMethod)="filterChartOfAccountSaleCode($event)"                                 (onSelect)="onSelectedChartOfAccountsSaleCode($event)"                                 [minLength]="1"                                 inputStyleClass="form-control"                                 styleClass="width-percent-100">                                 <ng-template let-chartOfAccount pTemplate="item">                                     {{chartOfAccount.name}}                                 </ng-template>                             </p-autoComplete>                         </div>  </div>


4 Answer(s)
  • 0
    demirmusa created

    It should work. Can you please remove [hidden]and check if autocomplete work. And you can also consider using *ngIf. But hidden should work.

  • 0
    sophoana created

    Hi support

    My task I want to show like this:

    image.png

    HTML File:

    <div class="row mb-4">                         <div class="col-sm-12">                             <span class="clickable-item text-muted" *ngIf="!CustomerSettingAreShown" (click)="CustomerSettingAreShown=!CustomerSettingAreShown"><i class="fa fa-angle-down"></i> {{"ShowCustomerSetting" | localize}}</span>                             <span class="clickable-item text-muted" *ngIf="CustomerSettingAreShown" (click)="CustomerSettingAreShown=!CustomerSettingAreShown"><i class="fa fa-angle-up"></i> {{"HideCustomerSetting" | localize}}</span>                         </div>                     </div>                      <div class="row mb-4" [hidden]="!CustomerSettingAreShown">                         <div class="form-group col-md-6">                             <label for="CustomerSaleCode">{{"CustomerSaleCode" | localize}}</label>                                                         <p-autoComplete                                 id="SingleSelectSaleCodeInput"                                 name="SingleSelectSaleCodeInput"                                 field="name"                                 [(ngModel)]="chartOfAccountSaleCode"                                  [suggestions]="filteredChartOfAccountSaleCode"                                 (completeMethod)="filterChartOfAccountSaleCode($event)"                                 (onSelect)="onSelectedChartOfAccountsSaleCode($event)"                                 [minLength]="1"                                 inputStyleClass="form-control"                                 styleClass="width-percent-100">                                 <ng-template let-chartOfAccount pTemplate="item">                                     {{chartOfAccount.name}}                                 </ng-template>                             </p-autoComplete>                         </div>                     </div>

  • 0
    demirmusa created

    Did you control your p-autoComplete? Is it work without hidden? And also check whether you can see p-autoComplete in chrome inspector

  • 0
    demirmusa created

    Screenshot_1.png


    Screenshot_2.png