akveo / akveo/ng2-smart-table

Display the button action (edit, delete)

Abierto
#1,088 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
1.6k
Forks
867
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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 !!

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.