akveo / akveo/ng2-smart-table

Display the button action (edit, delete)

Đang mở
#1,088 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
1.6k
Fork
867
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi everyone,

Maybe someone can help me, I just want to know how to display the button action (edit, delete) only for some brands.
For example, as you can see on this screen capture, if the brands is Peugeot i doesn't want to display the button action.

ID | User | Marque | Actions

1 | Bret Litt  | Citroen | EditDelete
2 | Ervin Paula | Citroen | EditDelete
3 | Ervin Howell | Peugeot | EditDelete
4 | Erica Howell | Peugeot | EditDelete
5 | Ervin Howell | Citroen | EditDelete

html
`

`

.ts

`import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-table',
templateUrl: './table.component.html',
styleUrls: ['./table.component.css']
})
export class TableComponent implements OnInit {
data: any;
settings: any;
constructor() { }

ngOnInit() {

this.settings = {
actions: {
add: true,
edit: true,
delete: true,
custom: [{ name: 'ourCustomAction', title: '' }],
position: 'right'
},
columns: {
id: {
title: 'ID',
filter: false,
},
name: {
title: 'User',
filter: false,
},
marque: {
title: 'Marque',
filter: false,
}
}
};
this.data = [
{
id: 1,
user: "Leanne Graham",
marque: "Bret",
},
{
id: 2,
name: "Ervin Paula",
marque : "Citroen",
},
{
id: 3,
name: "Ervin Howell",
marque : "Peugeot",
},
{
id: 4,
name: "Erica Howell",
marque : "Peugeot",
},
{
id: 5,
name: "Ervin Howell",
marque : "Citroen",
}
];
}

}
`

thanks !!

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.