Show Edit button on conditions
Show Edit button on conditions
Hello,
Is it possible to show button based on external condition ?
buttons: [
{
extend: 'pdfHtml5',
className: 'btn-datatable',
orientation: 'landscape',
pageSize: 'LEGAL',
},
{
extend: 'print',
className: 'btn-datatable',
text : 'Imprimer',
orientation: 'landscape',
pageSize: 'LEGAL',
},
{
extend: 'excel',
className: 'btn-datatable',
},
{
extend: 'colvis',
collectionLayout: 'two-column',
text : 'Colonne Visible',
className: 'btn-datatable',
},
{
extend: 'edit',
editor: editor,
},
],
I'd like to show the "Edit" button if the user has certain right.
Thanks !
Pauline.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Yes - the API methods
button().show()
andbutton().hide()
can be used.Another option is to simply put an
if
condition around the button:Allan
Note - these methods do not exist in 2019 - links removed
Thank you Allan !