Creating 2 buttons on Same Screen Sencha Architect 2 - sencha-architect

I'm following this tutorial to create a Sencha Touch Application,
I want to create 2 buttons on the same screen and each button redirect to another page when clicked, on the tutorial it use Form panel and only one button to redirect to another page, but if I link 2 Form Panels to the Navigator View, it only appear one form panel, I want to know a way to add 2 buttons on the same screen and call one userAlias for each button to redirect to the another page.
What I do ? Add 2 buttons on the same FormPanel ? If yes, how I call one diferent page for each button, because I use only one userAlias on the form panel with this function:
button.up('navigationview').push({
xtype: 'step3',
title: 'Step 3'
});
Thanks for the help

use two different handlers for the buttons.
Example :: Button 1 ::
{
xtype : 'button',
text : 'button 1',
handler : function(){
alert('do something');
this.up('navigationview').push({ . . . . });
}
}
Example :: Button 2 ::
{
xtype : 'button',
text : 'button 2',
handler : function(){
alert('do something else');
this.up('navigationview').push({ . . . . });
}
}

Related

Jquery UI dialog does not appear. It says $(...).dialog is not a function

http://ramin.azerizone.net/qiymet.html
Here is my demo webiste. In right side if I click red button, it says "dialog is not function". Although I have included jquery, and jquery ui. My script as below:
$(document).ready(function() {
$('#order_services_button').on("click", function() {
$("#dialog-form").dialog({
height : 320,
width : 350,
modal : true
});
});
});
This is because you are including two jQuery/jQueryUI files.Remove the duplicate script tags and the dialog should work.

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

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
}

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" });

YUI MenuButton: menu doesn't show when menu widget is added to button widget

Using YUI, I want to create a menu button, passing in the menu widget instance.
Result is what looks like a menu button, but the menu doesn't show.
test case: http://sandbox.kluger.com/menu_test.html
// key code section:
var D = YAHOO.util.Dom,
menu = new YAHOO.widget.Menu(D.generateId(), {lazyload: true});
menu.addItems(params.menu);
var t = new YAHOO.widget.Button({
type: "menu",
label: params.label,
menu: menu,
container: el
});
Do I need to render the menu before giving it to the Button?
If you want to see the params.menu, check the test case. The params.menu object is correct, it creates a menu when directly supplied to widget.Button. That's tested in the test case.
Any ideas appreciated.
Yes, you need to render. Add menu.render(document.body); after menu.addItems(params.menu); and it should work fine.

Resources