0

I would like to know if it is possible to add a custom global table action which replaces the 'Add new' button for the ng2-smart-table smart table package, which I use as part of Nebular admin dashboard (https://akveo.github.io/nebular/).

In this case, we want to add a 'Show all' button, which interacts with another element of the application. I know that adding custom actions is it possible, but for our functionality we need this button at thead level.

Maybe an approach could be to modify the default behaviour of the add action at the settings JSON of the smart table, but we didn't achieve it.

Global table actions are mentioned at official docs, at section Table Configuration, hideSubHeader property: https://akveo.github.io/ng2-smart-table/#/documentation

xabicasado
  • 13
  • 4
  • I suggest adding some mention of the package you're using at the start of your question... You're assuming, we the readers, know this. Also, some code samples can help us, help you. – James D Jan 22 '21 at 09:12
  • Sorry, I added the library name at the tags but forgot to mention it in the question itself. Post edited with the information. – xabicasado Jan 22 '21 at 11:16

1 Answers1

0

You can change the Add icon in the table settings and configure external mode to hook an event listener to the (create) event in the template.

mode: 'external',
add: {
  addButtonContent: '<i class="nb-plus title="Show All"></i>',
},
Juanpa
  • 163
  • 1
  • 9