ng2-smart-table
ng2-smart-table copied to clipboard
How to get data from specific row in table ng2 smart table
I'm working on ngx-admin in ng2 smart table I added a custom button(buttonComponent) that open model I want to pass data where the button exist
settings = {
actions: {
add: false,
},
add: {
addButtonContent: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
},
edit: {
editButtonContent: '<i class="nb-edit"></i>',
saveButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
confirmSave: true,
},
delete: {
deleteButtonContent: '<i class="nb-trash"></i>',
confirmDelete: true,
},
columns: {
_id: {
title: "ID",
type: "number",
},
nameUser: {
title: "nameUser",
type: "string",
},
contactName: {
title: "contactName",
type: "string",
},
phone: {
title: "phone",
type: "number",
},
email: {
title: "E-mail",
type: "string",
},
role: {
title: "role",
type: "string",
editor: {
type: "list",
config: {
selectText: "Select the Location to see options...",
list: this.roles,
},
},
},
city: {
title: "city",
type: "string",
},
postCode: {
title: "postCode",
type: "string",
},
registerAddress: {
title: "registerAddress",
type: "string",
},
address: {
title: "address",
type: "string",
},
bindedGroup: {
title: "bindedGroup",
type: "string",
},
tid: {
title: "tid",
type: "string",
},
bindedSn: {
title: "bindedSn",
type: "html",
valuePrepareFunction: (cell, row) => {
console.log(row.bindedSn);
this.bnsn = row.bindedSn;
return row.bindedSn;
// console.log(row);
},
},
bindedTime: {
title: "bindedTime",
type: "string",
},
longitude: {
title: "longitude",
type: "string",
},
latitude: {
title: "latitude",
type: "string",
},
localisation: {
title: "localisation",
type: "string",
},
openModal: {
title: "openModal",
type: "custom",
renderComponent: NbListComponent,
},
},
};
as shown at last column there is a button that open a modal , by clicking on the button I want to pass bindedSn data of it's row .
NB: tableComponent and modalComponent are not linked as parent and child