Hiding Editor default buttons on table initialisation

Hiding Editor default buttons on table initialisation

petrusepetruspetrusepetrus Posts: 1Questions: 1Answers: 0

Hi Allan -

Newbie question I'm afraid.

I have a table of customer enquiries that I receive via a WordPress site that are stored in a mySQL table. I have successfully set up Editor to perform basic editing of the table and that works absolutely fine. I would, however, like to hide the Create button at table initialisation so that it is not visible by default (I just want my user to either process the enquiry or delete it but not create new ones).

I'm sure there will be a way to do this but I'm struggling to find the method. Any help appreciated.

Answers

  • allanallan Posts: 63,457Questions: 1Answers: 10,465 Site admin

    If you never want the user to create new records, you could simply remove the create button from your array of Buttons.

    If however, there are some circumstances under which the create button can be used, I would suggest adding it when those circumstances are met. You can use button().add() to add a button dynamically.

    Allan

This discussion has been closed.