question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

this.nzDropdownMenu.descendantMenuItemClick$ is undefined

See original GitHub issue

Reproduction link

Demo

Steps to reproduce

I am trying to make custom filter in my table but i’m unable to open dropdown, it return error of

ERROR TypeError: this.nzDropdownMenu.descendantMenuItemClick$ is undefined

What is expected?

Open each table heading dropfown

What is actually happening?

get error

01101

Environment Info
ng-zorro-antd 10.1.2
Browser Firefox

Code

<th *ngFor="let column of listOfColumns; let i = index;">
                {{ column.name }}
                <nz-filter-trigger [(nzVisible)]="visible" [nzActive]="searchValue.length > 0" [nzDropdownMenu]="'menu' +  i">
                  <i nz-icon nzType="caret-down"></i>
                </nz-filter-trigger>
                <!-- filter fields -->
                <nz-dropdown-menu #menu{{i}}="nzDropdownMenu">
                    <div class="search-box p-2" *ngIf="visible">
                      <div class="mb-2">
                        <label for="">Search By {{ column.name }}</label> <br>
                        <input nz-input placeholder="Type here..." />
                      </div>

                      <div class="mb-2">
                        <label for="sort">Sort Order</label> <br>
                        <nz-select ngModel="none" class="text-left mr-2" style="width:100%;">
                            <nz-option nzValue="none" nzLabel="None"></nz-option>
                            <nz-option nzValue="asc" nzLabel="Ascending"></nz-option>
                            <nz-option nzValue="desc" nzLabel="Descending"></nz-option>
                        </nz-select>
                      </div>

                      <div class="mb-2">
                        <label for="op">Filter Column</label> <br>
                        <nz-select ngModel="contains" class="text-left mr-2" style="width:100%;">
                            <nz-option nzValue="contains" nzLabel="Contains"></nz-option>
                            <nz-option nzValue="like" nzLabel="Like"></nz-option>
                        </nz-select>
                      </div>
                      <button type="button" class="btn btn-warning w-100 mt-2" (click)="search()"><i class="fe fe-search"></i> Search</button>
                    </div>
                </nz-dropdown-menu>
                <!-- filter fields -->
</th>

Note If I use [nzDropdownMenu]="menu" and #menu="nzDropdownMenu" (as of documents) it will open all headers dropdown at the same time but since I’ve added index number to have unique ids it returns this error (mentioned above).

any idea?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
to0simplecommented, Nov 30, 2020

@to0simple

<th *ngFor="let column of listOfColumns; let i = index;">
  {{ column.name }}
  <nz-filter-trigger [nzActive]="searchValue.length > 0" [nzDropdownMenu]="'menu' + i">
    <i nz-icon nzType="caret-down"></i>
  </nz-filter-trigger>
 
  <!-- filter fields -->
  <nz-dropdown-menu #menu{{i}}="nzDropdownMenu">
  ..... rest of it...

Also as your sample <nz-dropdown-menu #menu{{i}}> none of them work 😞 did I miss something from your sample?!

<th *ngFor="let column of listOfColumns; let i = index;">
  {{ column.name }}
  <nz-filter-trigger [nzActive]="searchValue.length > 0" [nzDropdownMenu]="menu">
    <i nz-icon nzType="caret-down"></i>
  </nz-filter-trigger>
 
  <!-- filter fields -->
  <nz-dropdown-menu #menu="nzDropdownMenu">
  ..... rest of it...

u can try this way . remove i

0reactions
robertnicjoocommented, Nov 30, 2020

@to0simple Thanks man it worked eventually ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

https://git.zgwit.com/iot/master/commit/9a4b260594...
descendantMenuItemClick $.next(e)}onChildMenuItemClick(e){this. ... if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof at(e).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found