I am using ng2-smart-table in my angular project, its working as expected. I just want to know how can I show row number in each row. From documentation and examples on google, all I can think of is setting a property in the data itslef , which is not a good idea. If there is any way or work around please suggest. here is my data settings and sampel data to my ng2-smart-table
settings2 = {
columns: {
id: {
title: 'ID',
filter: true,
},
name: {
title: 'Fact',
filter: true,
},
description: {
title: 'Description',
filter: true,
},
},
actions: {
add: false,
edit: false,
delete: false,
custom: [
{
name: 'view',
title: `<i class="ti-eye text-success m-r-10" data-target="#view"></i>`,
},
{
name: 'edit',
title: `<i class="ti-pencil text-info m-r-10" data-target="#update"></i>`,
},
{
name: 'delete',
title: `<i class="ti-trash text-danger m-r-10"></i>`
},
]
}
}
Data -
[{
"id": "770e6370-cf14-4a0a-b9db-0a6e99b5783b" ,
"list": [
{
"description": "Coopentity" ,
"type": "CO_OP"
} ,
{
"description": "" ,
"type": "FARM"
} ,
{
"description": "" ,
"type": "FACTORY"
} ,
{
"description": "" ,
"type": "AUDITING_FIRM"
}
] ,
"name": "entity_types"
}]
HTML -
<ng2-smart-table [settings]="settings2" [source]="facts" (custom)="onCustom($event)" class=""></ng2-smart-table>