Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the label at runtime? #743

Open
crystalfp opened this issue Dec 20, 2020 · 1 comment
Open

How to change the label at runtime? #743

crystalfp opened this issue Dec 20, 2020 · 1 comment

Comments

@crystalfp
Copy link

crystalfp commented Dec 20, 2020

I have defined menu items with a function for disabled and another for icon changing the menu entry depending on the program status. Now I want to change the menu entry label too, but seems there is no mechanism in place to to this. Is it a missing functionality or there is another method to change the label?
I'm using the 3.x branch.
Thanks!
mario

@crystalfp
Copy link
Author

Ugly workaround. Create entries with the different labels and use visible attribute to show the correct one:

				archive: {
					name: "Archive",
					callback: archiveProject,
					icon: "fa-archive",
					visible: () => status !== "ARCHIVED"
				},
				dearchive: {
					name: "De-Archive",
					callback: deArchiveProject,
					icon: "fa-archive",
					visible: () => status === "ARCHIVED"
					}
				},

Using branch 3.x. Hoping in a better solution...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant