webview links inside tableviewrow not clickable
Trying to write my first iPhone app using Appcelerator from the 2-tab starter project. The 1st tab is a table of items with children detail pages. The detail pages include a description with embedded links to glossary terms. The 2nd tab is the table of glossary terms with detail pages of definitions.
So I tried to embed a webview into a tableviewrow that will link back via fireEvent
to switch tabs and navigate to the appropriate glossary term. I am testing using just a simple URL instead of the JS to fireEvent
, but clicking on the hyperlink has no effect. Suggestions?
var data = [];
data[0] = Titanium.UI.createTableViewSection({headerTitle:'Definition'});
var defnRow = Titanium.UI.createTableViewRow({
height:'auto'
});
var defnWebView = Titanium.UI.createWebView({
html:'<html><body>Description with <a href="http://www.google.com">link</a></body></html>',
height:'auto'
});
defnRow.add(defnWebView);
data[0].add(defnRow);
var table = Titanium.UI.createTableView({
data:data,
style:Titanium.UI.iPhone.TableViewStyle.GROUPED,
allowsSelection:false,
});
1 Answer
-
I wouldn't suggest you to do this. Each webview you are opening will eat a lot of CPU. Why don't you simple use the table click event ?
And if you want custom rows you may want to take a look at this tutorial:
http://cssgallery.info/custom-row-for-tableview-in-appcelerator-titanium/