titanium-alloy

Getting ID of clicked TableRow in Titanium Alloy?

最后都变了- 提交于 2019-12-11 00:04:29
问题 I'm new to Titanium and to Backbone. I've worked with JS frameworks before (most familiar with Knockout.js), but Backbone, and the way it works with Alloy, is taking some getting used to. I want to do something very simple. I have a collection bound to a TableView. All I want to do is get the data associated with a particular row when it is clicked. The should be trivial, but all the docs seem to assume you know how to use Alloy already! Model exports.definition = { config: { columns: {

Issue with update query in titanium alloy

半世苍凉 提交于 2019-12-10 23:56:58
问题 I'm new to titanium and alloy framework. I have created the models to store some data. I am able to insert and retrieve the data. I don't know How to update the row. As suggest I did as follows, var userLang = Alloy.Collections.userLanguage; var models = Alloy.createModel("userLanguage"); models.fetch({id: 1}); models.save({ languageID: langID, languageText: lang }); The above code s not showing any error, But when I try to select a row from the table, var userLang = Alloy.createModel(

Can't hide titlebar Titanium with Alloy

余生颓废 提交于 2019-12-10 18:25:13
问题 I have encounterd a problem in Titanium Appcelerator using Alloy MVC. This problem contains the following(see image) I can't remove the black bar where the app name and logo is found. I am running the app on a device(Google Nexus, no simulator) I have tried the following to remove this: XML: <Alloy> <Window> </Window> </Alloy> TSS: "Window": { navBarHidden:true, fullscreen:true, backgroundColor:"Orange", orientationModes:[Ti.UI.PORTRAIT], } TiApp.XML: <statusbar-style>default</statusbar-style

titanium alloy: calling controller function from another controller

余生颓废 提交于 2019-12-10 11:34:25
问题 Using SDK 3.2.0 I have a index controller that defines a function to set Android Menus. I want to call that function from a variety of controllers that are nested loaded throughout the App. Code: //index.js exports.setMenus = function(enabled) { var activity = $.index.getActivity(); activity.onCreateOptionsMenu = function(e){ /... }; activity.onPrepareOptionsMenu = function(e) { /... }; activity.invalidateOptionsMenu(); }; Alloy.Globals.Index = $; Then, way after, inside home controller , I

How to create a request string with passing different values in Titanium?

痴心易碎 提交于 2019-12-08 14:04:50
问题 I am creating a URL-String like this: URLString = %@sale-ws/lots/sales?yardNumber=%@&saleFromDate=%@&range=%@&saleToDate=%@&pageSize=%@&pageNo=%@&sortBy=%@&sortType=%@&filterStartYear=%@&filterEndYear=%@&filterMake=%@&filterModel=%@&filterLocationId=%@&filterLane=%@&filterSellerId=%@&searchInSearchString=%@ So in Titanium i want to pass the values dynamically into a given string. I tried this one but did not get a proper response. var urlParameterStringNew =String.format(URLString,Alloy

How to import a widget in alloy titanium

一曲冷凌霜 提交于 2019-12-08 13:58:26
Newbie question here: I'm fiddling around with titanium studio with alloy mvc and starting to get the hang of it. It's just not clear to me how I can import a widget into my project. I found a nice slider menu and want to use this in my own project. Now the docs say you have to add a dependency in the config.json like so: "dependencies": { "com.slider" : "1.0" } and then you'd be able to use it in your view: <Widget src="com.slider"></Widget> But don't I need to import it into my project first? And if so, how? Importing it as a project only adds it to my workspace, not in my project user

Dynamic style change in Titanium Alloy

泄露秘密 提交于 2019-12-08 10:34:24
问题 I am new to the Titanium-Alloy. I am creating a 9X9 matrix using xml mark up. I want to change the background color of all the cells if I clicked on a single cell. My questions are 1) Can I use class property like in jquery $(".col").click(function() { $(".col").css("background-color","red"); }); 2) Should I change the background color using id property of each and every cell 3) Is it possible to assign a common click listner to all the cells. Following is my xml markup <View id="rowContainer

How to retrive values from Database in Titanium Alloy?

烂漫一生 提交于 2019-12-06 22:47:33
I'm new to Titanium API. I want to know how to retrieve values from DB and display in UI. I created a model and inserted a row. My code is as below, Model: var moment = require('alloy/moment'); exports.definition = { config : { "columns": { "id":"text", "LanguageName":"text" }, "adapter": { "type": "sql", "collection_name": "UserLanguage" } }, extendModel: function(Model) { _.extend(Model.prototype, { }); return Model; }, extendCollection: function(Collection) { _.extend(Collection.prototype, { }); return Collection; } }; View: <Alloy> <Window id="changeLangWindow" title="Plan India"> <Picker

how to change hintText color in textField Titanium?

我的未来我决定 提交于 2019-12-06 13:59:47
this is my code,and I want to change the hintText Color, how to do? "#email":{ width: '70%', left:'13%', font:{ fontSize:'20sp' }, color: '#fff', hintText:'请输入手机号', borderColor:'transparent', bottom:'2%', //backgroundColor:'#d9d9d9', backgroundColor:'transparent', borderStyle:Ti.UI.INPUT_BORDERSTYLE_ROUNDED } actually you can't i tried before here what i did to change the hint color and font you need to create a view , textfeild and label with adding change listener on textfeild to show or hide the hint var mh_view = Ti.UI.createView({ backgroundColor : "white", height : "40dp", top : "224dp",

how to live view in Titanium?

百般思念 提交于 2019-12-06 10:53:32
问题 My team have been developing Titanium in the past few months, and now we are facing a problem: when we make changes on the View code(change its font, its background or size) , it takes a long time ( about 1 minute ) until we see the result displayed on device. that is really a big waste of time. I saw the TiShadow already, it's great, but it only support js code( like Alloy.createTableList... ), doesn't support the Alloy XML( I mean you can't see your changes displayed on the screen once