How do I add sub items to the main menu, and how do I put it on the side of the page? - node.js

How do you add a navigation menu bar which is positioned on the left side of the home page of a Vcl.js application?
How do you create sub menu items to the top menu navigation bar on the home page?
I am looking at the sample Customer Center example that was provided for the vcl.js framework.

menu handling is done on main.ts at the application level
var item = V.Application.addNavbarItem("HOME2", "icon-home icon-white", () => {
V.Application.navigateToPage("PageHome2", []); //this is the default click event
});
var subitem = b.addMenuItem('submenu');
subitem.onClicked = () => {
//on click
}

Related

BarButtonItems not visible in iOS 11

I have an iOS app developed using Xamarin. Now I am trying to migrate it to iOS 11. My problem is that none of the BarButtonItems in navigation bars are visible in any controller, yet they are functional and I can tap them.
some of those button items are set in storyboard, by adding Navigation Item into the controller. titles of those button items are also invisible. even the standard back button.
the other bar button items are set in code by SetRightBarButtonItem or SetLeftBarButtonItem. I have both custom icon buttons and system item buttons. an example for system item button is:
this.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Stop, (sender, e) => { ... }), true);
and another with custom icon button:
this.NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(UIImage.FromBundle("gear"), UIBarButtonItemStyle.Plain, (sender, e) => { ... }), true);
These navigation bar button items have been working without problems for a long time. how can I fix them with the new navigation bar structure in iOS 11? (I do not enable large titles in navigation bars)
Just do something like this.
var button = new UIBarButtonItem(UIImage.FromBundle("gear"),UIBarButtonItemStyle.Plain, (sender, e) => { ... });
button.SetTitleTextAttributes(new UITextAttributes()
{
TextColor = UIColor.Blue,
TextShadowColor = UIColor.Clear
}, UIControlState.Normal);
this.NavigationItem.SetRightBarButtonItem(button, true);

Electron - Change Menu Bar in Different Windows

In my electron app, a user can open different windows.
I have the menu initialized when the main window is created like so:
const menuContents = Menu.buildFromTemplate(menuTemplate(mainWindow))
Menu.setApplicationMenu(menuContents)
However, when a user clicks a link and opens a new window, this same menu bar still appears in that window. I would like to change it and/or completely remove it.
How would I do that?
It's possible:
Example for Menus
In Renderer or Main Proccess make two functions with menu templates like this:
main menu
function createMenu(){
var menu = Menu.buildFromTemplate([
{
//your menu items
}
])
Menu.setApplicationMenu(menu);
}
second menu
function createMenuwin(){
var menu = Menu.buildFromTemplate([
{
//your other window menu items
}
])
Menu.setApplicationMenu(menu);
}
when you call the second window : Example open an image
function openIMG(path){
win = new BrowserWindow({
width: 800,
height: 550,
frame: true,
vibrancy: 'medium-light',
});
win.loadFile(path);
createMenuwin();
win.on('close', () =>{
createMenu();
})
}
when the second window is open create an app menu with
createmenuwin()
when the second window is closed call the event:
win.on('close', () =>{})
inside the close event of the second window, call:
createMenu();

Xamarin side menu tap issue

I developed an app using Xamarin forms that has side menu see this url.
But I couldn't use this in my current project, so I made my custom component for side menu.
How to implementing feature that hide menu when I tap range out of side menu?
It is hard to give you any help without seeing your code, but generally I tackle this issue by adding a ContentView that covers the screen when ever your menu opens. The menu would be displayed on top of the ContentView. Then you add a TapGestureRecognizer to the ContentView which closes the menu when clicked.
You could add some color to the ContentView but make it opaque so it is see-through, something like this color: #74787878
ContentView backgroundView = new ContentView {
BackgroundColor = Color.FromHex("#74787878"),
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Content = //Your menu
}
backgroundView.GestureRecognizers.Add(new TapGestureRecognizer {
Command = new Command(() => {
//Remove the background and hide the menu
})
});

How can I pass the selected Kendo Menu Text to Controller

How can I pass the selected Kendo Menu Text to Controller???
menu.Add()
.Text("Reports")
.Items(item =>
{
item.Add().Text("Home").Action("Index","Sample");
item.Add().Text("About Us").Action("Index", "Sample");
});
Since both the menu items call the same controller, I need to pass the Menu Items Text to the controller to identify which menu was selected...
You can use the route values:
item.Add().Text("Home").Action("Index","Sample", new { text = "home" });
item.Add().Text("About Us").Action("Index", "Sample", new { text = "about us" });

dijit menu onmouseover

I am using menu using dijit.menu and Its work with right click and left click.
How I open the menu on mouse over and close on onmouseout?
dijitActionMenu = new dijit.Menu({
targetNodeIds:[actionMenuId],
leftClickToOpen:"true"
});
Have you tried something like
// Create a new Tooltip
var tip = new dijit.Tooltip({
// Label - the HTML or text to be placed within the Tooltip
label: '<div class="myTipType">This is the content of my Tooltip!</div>',
// Delay before showing the Tooltip (in milliseconds)
showDelay: 250,
// The nodes to attach the Tooltip to
// Can be an array of strings or domNodes
connectId: ["myElement1","myElement2"]
});
More details are here dialogs_tooltips.Even dijit.Menu have onMouseOver even.
onMouseOver Event
I am able to get the dijit/Menu onmouseover.
Create an element which will invoke onmouseover event.
Element
show() will call custom widget which will create menu for you.
E.g.,
show = function() {
var roll = new rollover()
}
And rollover.js will be the custom widget.
From the constructor of it, you can invoke the function and create the menu.
pMenu = new Menu({ class: "rollovermenu", id: "rolloverid" });

Resources