ngx-datatable
ngx-datatable copied to clipboard
ngx-datatable-tree-toggle directive is not working
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
@marjan-georgiev can you merge this change please, I really need this. Thanks issue #1790
Please merge this PR, we really need this urgently.
Please merge. Still waiting for it.
Any movement on this? I just came across this today as well.
just wondering if its already merged or not?
@jsnelcer Hi, is there any update?
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
Hi, this seems like a pretty isolated and simple change that fixes a broken feature. Any update on merging the pull request?
@Hypercubed Please merge this PR, we really need this.
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 ?
Hello! When will this be merged? @Hypercubed @joeveiga
Bump for visibility - we are also facing this issue. Since the PR seems to "only correct" an accidental oversight, can this please be merged?
Hello, do you know when this is going to be merge ? @t2yaroslav
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.
Just another bump (for merge).
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
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...