In ng2-smart-table, I want a button 'Start' or 'End' which I am showing conditionally. How can I do this? I am having a condition If that's true, then I want to show 'Start' button and if it is false, then I want to show 'End' button. Also, I need to perform something if a user clicks these buttons.
tableSettings = {
actions: false,
columns: {
code: {
title: 'Code'
},
first_name: {
title: 'First Name'
},
last_name: {
title: 'Last Name'
},
email_id: {
title: 'Email'
},
start_time: {
title: 'Start Time',
type: 'date',
valuePrepareFunction: (date) => {
return this.renderDateTime(date);
}
},
end_time: {
title: 'End Time',
type: 'date',
valuePrepareFunction: (date) => {
return this.renderDateTime(date);
}
},
start: {
title: 'Start/End',
type: 'html',
valuePrepareFunction: (cell, row) => {
return `<button *ng-If="renderButton(row) === 'Start'" (click)="startTest()">Start</button>`;
}
}
}
};