neoMenu - Forum

Forum Navigation
You need to log in to create posts and topics.

neoMenu

Hi luis, we can add an item to the menu with this command:

neoMenuAddItem "menu" "item 1" "" "mySubroutine" "First item"

Is there any way to remove an item from the menu?

@asmat, I don't think so. Anyway you can take a look at the original JavaScript library:
https://github.com/dgoguerra/bootstrap-menu

Let me know if you find any possibility.
Thank you!

asmat has reacted to this post.
asmat

@asmat
@luishp

Is there any way to remove an item from the menu?
Let me know if you find any possibility.

If you can live with the menu item NOT be shown/visible to the user (as opposed to being removed from the chain) ... on this page ... https://github.com/dgoguerra/bootstrap-menu ... it says (near the bottom) that isShown is a (function) attribute ... perhaps a commands like neoMenuHideItem and neoMenuShowItem could be developed.

There is also a (function) attribute called isEnabled ... if neoMenu is enhanced, neoMenuEnableItem and neoMenuDisableItem could be developed too.

 

asmat has reacted to this post.
asmat

@gaev @asmat I have attached neoMenu plugin source code.
I'm quite overwhelmed lately with projects but will try to assist you if you need me.
Best regards.

Uploaded files:
  • You need to login to have access to uploads.
asmat has reacted to this post.
asmat

Thank you @luis and @gave, I have added new two commands as below:

neoMenuIsShowItem "menu2" true 2
neoMenuIsEnableItem "menu2" false 1

 

Uploaded files:
  • You need to login to have access to uploads.
luishp has reacted to this post.
luishp

@asmat

Congratulations.

When I tested it ...

1) I found this anomaly ...

neoMenuIsEnableItem "menu2" false 1

This command by itself will show a horizontal line for the item that is disabled.

You need to invoke the additional command neoMenuIsShowItem "menu2" false 2 in order to not show the horizontal line.

I would have liked to see the disabled item's text be shown "greyed out" ... but nothing we can do about the way the javascript library reacts.

However, it might be best to invoke the neoMenuIsShowItem "menu2" false 2 functionality automatically as part of the neoMenuIsEnableItem "menu2" false 2 command ... saves the developer from doing so.

2) In order to make things consistent with the way other objects (widgets) are managed, may I suggest command formats like ...

neoMenuHideItem "menu2" 1
neoMenuShowItem "menu2" 1
neoMenuDisableItem "menu2" 1
neoMenuEnableItem "menu2" 1

 

3) This one is debatable, and I will let @luishp make the final decision.

Unlike VisualNEOWin, and in keeping with javascript convention, the item reference numbers (which are references to the array item), start at zero ... might be a bit confusing when the item text in the sample App refer to numbers starting with 1

So, it is debatable whether we should refer to items as 0, 1, 2 etc. or 1, 2, 3

 

luishp and asmat have reacted to this post.
luishpasmat