Editor - Switch off New / Delete / Edit buttons / display only functionality - can it be done ?
Editor - Switch off New / Delete / Edit buttons / display only functionality - can it be done ?
supportNE
Posts: 23Questions: 7Answers: 0
Hi
I have a situation where some users aren't allowed to add new rows / edit rows, but are allowed to view the existing rows. Is there an easy way within Editor that I can switch off the New / Edit / Delete buttons, and allow display only, e.g. an editor table with no edit function ?
Many thanks.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Editor doesn't control the buttons. You can use Buttons APIs like
button().disable()
orbutton().remove()
. Here is an example of adding/removing buttons dynamically:https://datatables.net/extensions/buttons/examples/api/addRemove.html
Or you can conditionally create the buttons array using a Javascript variable before initialization and use that variable. Something like:
Kevin
Thanks Kevin !