ngx-datatable icon indicating copy to clipboard operation
ngx-datatable copied to clipboard

ngx-datatable-tree-toggle directive is not working

Open jsnelcer opened this issue 5 years ago • 12 comments

What kind of change does this PR introduce? (check one with "x")

  • [X] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

if you use ngx-datatable-tree-toggle directive datatable always used default button because column.treeToggleTemplate was not setup

What is the new behavior?

setting treeToggleTemplate when is directive used

Does this PR introduce a breaking change? (check one with "x")

  • [ ] Yes
  • [X] No

jsnelcer avatar Nov 29 '19 13:11 jsnelcer

@marjan-georgiev can you merge this change please, I really need this. Thanks issue #1790

jsnelcer avatar Jan 08 '20 11:01 jsnelcer

Please merge this PR, we really need this urgently.

prabhatsingh-db avatar Jan 09 '20 08:01 prabhatsingh-db

Please merge. Still waiting for it.

Right5 avatar Feb 20 '20 09:02 Right5

Any movement on this? I just came across this today as well.

kyletanders avatar Mar 06 '20 23:03 kyletanders

just wondering if its already merged or not?

SilwalRaj avatar Apr 22 '20 07:04 SilwalRaj

@jsnelcer Hi, is there any update?

SilwalRaj avatar Apr 27 '20 06:04 SilwalRaj

no, I know nothing about it :/

po 27. 4. 2020 o 8:15 SilwalRaj [email protected] napísal(a):

@jsnelcer https://github.com/jsnelcer Hi, is there any update?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/swimlane/ngx-datatable/pull/1787#issuecomment-619750820, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI3OAPNYFE6UZFDM6L2WETTROUPJPANCNFSM4JS7RFAQ .

-- Jozef Šnelcer

jsnelcer avatar Apr 27 '20 06:04 jsnelcer

Hi, this seems like a pretty isolated and simple change that fixes a broken feature. Any update on merging the pull request?

nicknasirpour avatar Jun 12 '20 21:06 nicknasirpour

@Hypercubed Please merge this PR, we really need this.

joanroig avatar Jun 24 '20 09:06 joanroig

Hi ! I think a lot of people need this simple fix. Can someone from Swimlane merge this or give us a reason why it shouldn't be merged, please ? @marjan-georgiev @haeminn @Hypercubed or someone else ?

fantoine avatar Sep 30 '20 08:09 fantoine

Hello! When will this be merged? @Hypercubed @joeveiga

ursaciuc-adrian avatar Jul 07 '21 13:07 ursaciuc-adrian

Bump for visibility - we are also facing this issue. Since the PR seems to "only correct" an accidental oversight, can this please be merged?

gecko-steffen avatar Mar 15 '22 09:03 gecko-steffen

Hello, do you know when this is going to be merge ? @t2yaroslav

Liimint avatar Oct 04 '22 10:10 Liimint

Hello,

Will this not be merged ? ngtemplate doesn't see anything inside and default small button is displayed on tree which is not pleasant at all.

Ysera86 avatar Nov 30 '22 11:11 Ysera86

Just another bump (for merge).

ghost avatar Feb 27 '23 18:02 ghost

If anyone is looking for a work around for this since this PR is still open, you can use the ngx-datatable-cell-template instead.

<ngx-datatable-column  [isTreeColumn]="isTreeMode" [width]="75" [treeLevelIndent]="12">
  <ng-template ngx-datatable-cell-template let-row="row">
    <button (click)="onTreeAction(row)">
      <!-- Your toggle button here -->
    </button>
  </ng-template>
</ngx-datatable-column>

This will cause both the default toggle as well as the ngx-datatable-column template in the same cell. We can then use CSS to hide the default toggle.

::ng-deep {
  .datatable-tree-button {
    display: none !important;
  }
}

And the onTreeAction(row)...

public onTreeAction(row: any): void {
  if (row.treeStatus === 'collapsed') {
    row.treeStatus = 'expanded';
  } else {
    row.treeStatus = 'collapsed';
  }
  this._changeDetectorRef.detectChanges();
}

Hope this helps

jmw5598 avatar Apr 05 '23 12:04 jmw5598

For all who are waiting for this since 2019 or so (like myself), this fix is a bit of a hack -- The reason, i believe, is that they are using ng-container wrongly.

https://github.com/swimlane/ngx-datatable/pull/1881

Here's a PR fixing the root cause, also open for 4 years. Seems like @jsnelcer wants us to wait for no reason


Since I opened this PR, I've moved countries, gotten married, seen the northern lights... 😅 but this is still here waiting, reminding us all of the inevitable passage of time and the impossible task of merging a PR...

nicojones avatar Nov 21 '23 14:11 nicojones