I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[*] feature request
[ ] support request => Please do not submit support request here
Current behavior
It would be nice to have action buttons(e.g edit/delete). I am not sure if there is already a way to do this.
Expected behavior
We should be able configure action icons on rows, which should just emit an event with the row when the icon is clicked. We might be able to do this with templates, but not sure if we can get a reference to the row from a template.
Reproduction of the problem
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Table version: 0.7.x
Angular version: 2.0.x
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Language: [all | TypeScript X.X | ES6/7 | ES5]
Ya, you can do this with templates. See the demos for example
@amcdnl is it possible to use a custom template for a single cell only? Because i dont want to create a column template for each col if I only want to add an "options" column with 3 icons.
hey, here is a snippet on how to get what you want
<ngx-datatable-column name="id" >
<template let-column="column" ngx-datatable-header-template>
actions
</template>
<template let-row="row" let-value="value" ngx-datatable-cell-template>
<i class="pb-icon icon-edit" (click)="detail(row)"></i>
<i *ngIf="row.canDelete == true" class="pb-icon icon-garbage" (click)="delete(row)"></i>
<i *ngIf="row.canSend== true" class="pb-icon icon-send" (click)="send(row)"></i>
</template>
</ngx-datatable-column>
and events in your component:
detail(row: any) {
this.router.navigateByUrl('/details/' + row.id);
}
delete(row: any) {
}
send(row: any) {
}
Hopefully this will give you some more info
Hello @amcdnl, First thanks all workers this plugin. I like know if is possible use mix of list automatic and template. I see what @CanKattwinkel ask de same question, but in my project when I put the template the list hidden. This is corret?
Thanks
Hi, I am developing an internal framework and I am using this table. A question: how can I insert my own custom component for action buttons for each row?
Most helpful comment
@amcdnl is it possible to use a custom template for a single cell only? Because i dont want to create a column template for each col if I only want to add an "options" column with 3 icons.