How to use the alloy.createWidget function in alloy

To help you get started, we’ve selected a few alloy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github timanrebel / RebelFrame / WindowManager.js View on Github external
if (win.createStack) {
			addWinToStack(win.createStack, win);
		} else if (win.addToStack) {
			addWinToStack(win.addToStack, win);
		}

		if (OS_IOS) {
			// Sometimes we accidentally set modal and navGroup to true.
			// In that case 'modal' should be preferred, because modal windows are always opened in a new NavWindow
			if (win.navGroup && win.modalWin)
				win.navGroup = false;

			// Show SideMenu button and replace current centerWindow with this new Window
			if (win.showSideMenu) {
				// Show sideMenu button
				var sideMenuButton = Alloy.createWidget(Alloy.CFG.SideMenu.buttonWidget || 'rebel.MenuBarButton', {
					buttonType: 'hamburger',
					delay: 200
				});
				win.leftNavButton = sideMenuButton.getView();
				sideMenuButton.on('click', WM.toggleLeftNavDrawer);

				// Create SideMenu if not yet created.
				// Else replace current centerWindow with this Window
				setupNavDrawer({
					centerWin: WM.createNewNavWindow(win)
				});
			}
			// If window should be Modal Window
			// Also add it to a new navigationGroup
			else if (win.modalWin) {
				WM.createNewNavWindow(win).open({
github appcelerator / alloy / test / apps / testing / ALOY-86 / _generated / mobileweb / alloy / controllers / index.js View on Github external
}
        {
            __processArg(arguments[0], "__itemTemplate");
        }
    }
    var $ = this;
    var exports = {};
    $.__views.index = Ti.UI.createWindow({
        backgroundColor: "#fff",
        fullscreen: false,
        exitOnClose: true,
        id: "index"
    });
    $.__views.index && $.addTopLevelView($.__views.index);
    var __alloyId3 = [];
    $.__views.__alloyId4 = Alloy.createWidget("classic", "widget", {
        id: "__alloyId4"
    });
    __alloyId3.push($.__views.__alloyId4.getViewEx({
        recurse: true
    }));
    $.__views.__alloyId7 = Alloy.createWidget("npm", "widget", {
        id: "__alloyId7"
    });
    __alloyId3.push($.__views.__alloyId7.getViewEx({
        recurse: true
    }));
    $.__views.__alloyId0 = Ti.UI.createTableView({
        top: 20,
        data: __alloyId3,
        id: "__alloyId0"
    });
github appcelerator / alloy / test / apps / testing / ALOY-720 / _generated / ios / alloy / controllers / index.js View on Github external
}
        {
            __processArg(arguments[0], "$model");
        }
        {
            __processArg(arguments[0], "__itemTemplate");
        }
    }
    var $ = this;
    var exports = {};
    var __defers = {};
    $.__views.__alloyId0 = Ti.UI.createWindow({
        title: "NavigationWindow",
        id: "__alloyId0"
    });
    $.__views.__alloyId2 = Alloy.createWidget("alloy.button", "widget", {
        title: "ios",
        id: "__alloyId2"
    });
    doSave ? $.__views.__alloyId2.on("click", doSave) : __defers["$.__views.__alloyId2!click!doSave"] = true;
    $.__views.__alloyId0.rightNavButton = $.__views.__alloyId2.getViewEx({
        recurse: true
    });
    $.__views.info = Ti.UI.createLabel({
        height: Ti.UI.SIZE,
        width: Ti.UI.SIZE,
        color: "#000",
        textAlign: "center",
        font: {
            fontSize: "24dp",
            fontWeight: "bold"
        },
github appcelerator / alloy / test / apps / testing / ALOY-787 / _generated / android / alloy / widgets / my.widget / controllers / widget.js View on Github external
function Controller() {
    new (require("alloy/widget"))("my.widget");
    this.__widgetId = "my.widget";
    require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));
    this.__controllerPath = "widget";
    this.args = arguments[0] || {};
    if (arguments[0]) {
        var __parentSymbol = __processArg(arguments[0], "__parentSymbol");
        __processArg(arguments[0], "$model");
        __processArg(arguments[0], "__itemTemplate");
    }
    var $ = this;
    var exports = {};
    $.__views.widget = Alloy.createWidget("my.widget", "other", {
        id: "widget",
        __parentSymbol: __parentSymbol
    });
    $.__views.widget && $.addTopLevelView($.__views.widget);
    exports.destroy = function() {};
    _.extend($, $.__views);
    _.extend($, exports);
}
github pablorr18 / TiFlexiGrid / Image Gallery Sample / Resources / mobileweb / alloy / controllers / index.js View on Github external
});
    $.__views.fgWin.add($.__views.fgHeader);
    $.__views.fgHeaderTitle = Ti.UI.createLabel({
        text: "TiFlexiGrid",
        width: Ti.UI.SIZE,
        height: Ti.UI.SIZE,
        color: "#fff",
        font: {
            fontSize: 18,
            fontWeight: "bold"
        },
        bottom: 10,
        id: "fgHeaderTitle"
    });
    $.__views.fgHeader.add($.__views.fgHeaderTitle);
    $.__views.fg = Alloy.createWidget("com.prodz.tiflexigrid", "widget", {
        id: "fg",
        __parentSymbol: $.__views.fgWin
    });
    $.__views.fg.setParent($.__views.fgWin);
    exports.destroy = function() {};
    _.extend($, $.__views);
    var items = [];
    var showGridItemInfo = function(e) {
        alert("Title is: " + e.source.data.title + ". Image is: " + e.source.data.image);
    };
    $.fg.init({
        columns: 3,
        space: 5,
        gridBackgroundColor: "#fff",
        itemHeightDelta: 0,
        itemBackgroundColor: "#eee",
github fnando521 / AlloyMenuWidget / Menu / Resources / alloy / controllers / master.js View on Github external
});
    $.__views.masterWindow.add($.__views.header);
    $.__views.imgPlaceHolder = Ti.UI.createImageView({
        id: "imgPlaceHolder"
    });
    $.__views.header.add($.__views.imgPlaceHolder);
    $.__views.btnAndroidMenu = Ti.UI.createButton({
        visible: false,
        id: "btnAndroidMenu"
    });
    $.__views.header.add($.__views.btnAndroidMenu);
    $.__views.headerBottomBorder = Ti.UI.createView({
        id: "headerBottomBorder"
    });
    $.__views.masterWindow.add($.__views.headerBottomBorder);
    $.__views.menuWidget = Alloy.createWidget("menu", "widget", {
        id: "menuWidget",
        __parentSymbol: $.__views.masterWindow
    });
    $.__views.menuWidget.setParent($.__views.masterWindow);
    $.__views.windowContainer = Ti.UI.createView({
        backgroundColor: "orange",
        id: "windowContainer"
    });
    $.__views.masterWindow.add($.__views.windowContainer);
    $.__views.__alloyId3 = Ti.UI.createView({
        id: "__alloyId3"
    });
    $.__views.windowContainer.add($.__views.__alloyId3);
    $.__views.lblDefault = Ti.UI.createLabel({
        id: "lblDefault",
        text: "Default Landing View"
github CBMVC / CBMVC-Library-For-Titanium-Alloy / app / lib / util.js View on Github external
* @license MIT License http://www.opensource.org/licenses/mit-license.php
 *
 * @disclaimer THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

var Alloy = require('alloy'),
    debug = require('debug'),
    loading = Alloy.createWidget('loading', 'widget'),
    indexContainer, langObj;


/**
 * Utility namespace
 */
var Utility = function() {};

Utility.init = function(iContainer) {
    indexContainer = iContainer;
    var lang = this.loadObject('lang');
    if(lang === null) {
        lang = Alloy.CFG.defaultLanguage;
        this.saveObject('lang', lang);
    }
    langObj = require('langs/' + lang);
github tipsy-and-tumbler-ltd / TripLogr / Resources / iphone / alloy / controllers / ReportGenerator.js View on Github external
id: "__alloyId28"
    });
    $.__views.__alloyId27.add($.__views.__alloyId28);
    $.__views.fromDate = Alloy.createWidget("ti.ux.forms.row.timepicker", "widget", {
        minDate: "",
        maxDate: "",
        value: "",
        title: " Start Date",
        icon: "fa-clock-o",
        id: "fromDate",
        __parentSymbol: __parentSymbol
    });
    $.__views.__alloyId26.add($.__views.fromDate.getViewEx({
        recurse: true
    }));
    $.__views.toDate = Alloy.createWidget("ti.ux.forms.row.timepicker", "widget", {
        minDate: "",
        maxDate: "",
        value: "",
        title: " End Date",
        icon: "fa-clock-o",
        id: "toDate",
        __parentSymbol: __parentSymbol
    });
    $.__views.__alloyId26.add($.__views.toDate.getViewEx({
        recurse: true
    }));
    $.__views.__alloyId29 = Ti.UI.createTableViewRow({
        height: "80",
        backgroundColor: "#fff",
        font: {
            fontFamily: Alloy.CFG.fontNormal,
github appcelerator / alloy / samples / apps / advanced / proxy_property_requires / _generated / blackberry / alloy / controllers / index.js View on Github external
title: "static"
    });
    var __alloyId12 = [];
    $.__views.staticRow1 = Ti.UI.createTableViewRow({
        height: "50dp",
        id: "staticRow1",
        title: "1"
    });
    __alloyId12.push($.__views.staticRow1);
    $.__views.staticRow2 = Ti.UI.createTableViewRow({
        height: "50dp",
        id: "staticRow2",
        title: "2"
    });
    __alloyId12.push($.__views.staticRow2);
    $.__views.staticWidgetSection = Alloy.createWidget("com.foo.widget", "section", {
        id: "staticWidgetSection"
    });
    __alloyId12.push($.__views.staticWidgetSection.getViewEx({
        recurse: true
    }));
    $.__views.staticWidgetRow1 = Alloy.createWidget("com.foo.widget", "row", {
        id: "staticWidgetRow1"
    });
    __alloyId12.push($.__views.staticWidgetRow1.getViewEx({
        recurse: true
    }));
    $.__views.staticWidgetRow2 = Alloy.createWidget("com.foo.widget", "row", {
        id: "staticWidgetRow2"
    });
    __alloyId12.push($.__views.staticWidgetRow2.getViewEx({
        recurse: true