android - Create windows not showing URL Titanium -


I'm trying to create this app, and I'm using counter loop to add data, but I AddEventListener can not find the .js file to open the source path correctly I have verified with the properties that! I tried to do it on an alloy project but failed, so back to a conventional project. The code for app.gs file is given below:

  var win = Ti.UI.createWindow ({title: 'categories', exit on exit: true}); Var data = []; Square categories = [{title: "art", url: 'ap: // project 333 / processing / art / art category. {Title: "dance"}, {title: "automotive"}, {title: "books and literature"}, {title: "buildings"}, {title: "business"}, {title: "Title": "title": "title": "title": "title": "title": "title": "title": "title": "title": "title": "title": "title": "title": "title": "title" }, {Title: "movies"}, {title: "music"}, {title: "news"}, {title: "politics"}, {title: "sports"}, {title: "travel"}] ; For (i = 0; i & lt; = Categories.length - 1; i ++) {var row = TIU.Untentable WeaverRo ({URL: categories [url]. URL, hatch: true}); Var rowdata = Ti.UI.createLabel ({text: categories [i]. Title, color: '# 000', font: {fontSize: 24, fontWeight: 'italics', fontfamily: 'helvetica'}, is child: true ,}); Row.url = Categories [i] .url; row.add (rowdata); Line categories = categories [i]; data.push (line); } Var table = Ti.UI.createTableView ({}); table.setData (data); Table.addEventListener ('click', function (event) {if (event.row.categories.url) {var win1 = Titanium.UI.createWindow ({url: event.row.categories.url, title: event.row. Categories. Title, _parent: Titanium.UI.currentWindow}); win1.open ({url: event.row.categories.url});}}); Win.backgroundColor = 'white'; Win.add (table); win.open ();   

Here is the file that I am trying to open in a new window:

  var win1 = Ti.UI.currentWindow ({title: " Category art "}); Win1.backgroundColor = 'white'; Squared categories = [{title: "latest creation", path: "art / latest works / loannatguide.js"}, {title: "tutorial"}, {title: "artist"}, {title: "exhibitions"}] ; Var data = []; For (i = 0; i & lt; = Categories. Lamps - 1; i ++) {var line = Ti.UI.createTableViewRow (); Var rowdata = Ti.UI.createLabel ({text: categories [i]. Title, color: '# 000', font: {fontSize: 24, fontWeight: 'italics', font-description: 'helvetica'}, is child: truth} ); Row.path = Categories [i] .path; Row.add (rowdata); Row.hasChild = rowdata.hasChild; data.push (line); } Var table = Ti.UI.createTableView ({}); Table.setData (data); Table.addEventListener ('click', function (e) {if (e.row.path) {var nextWin = Titanium.UI.createWindow ({path: e.rowData.path, title: e.rowData.title}); NextWin.open ();}}); Win1.add (table); Win1.open ();   

Any kind of help would be highly appreciated. In addition, this is for an Android app, so the iPhone navigation is out of the question.

Yes, the way you need to fix the path.

{title: "art", url: '/ art / artcategory.js'}

Also in your artcategory.js var win1 = Ti.UI.currentWindow ({title: "Art category"}); with

  var win1 = Ti.UI.currentWindow; Win1.title = "Art category";   

Hope this will work

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -