-
14 Mar 2011 6:13 AM #1
Toolbar button anchor link
Toolbar button anchor link
I'm fairly new to the Sencha Touch API. I'm trying to do something that it's fairly easily accomplished in other Javascript APIs such as JQuery and Mootools, but I'm struggling to get this issue worked out.
I have a panel with several elements, one of which is a bit of text combined with an anchor link, for example:
I would like to have the functional equivalent of the anchor link attached to a button on a toolbar. In theory, something like this:Code:var myPanel = new Ext.Panel({ id: 'my-panel', dock: 'top', cls: 'my-panel', dockedItems: [{ id: 'my-link', cls: 'my-link', dock: 'top', html: '<a href="http://www.google.com'">Google</a>' }] });
It seems likely to me that there would be a way of navigating away from my Sencha Touch app to an external url specified by a link on a toolbar button.Code:var myToolbar = new Ext.Toolbar({ dock: 'top', items: [{ iconCls: 'my-toolbar', text: 'Google!', html: '<a href="http://www.google.com">Google</a>' }] });
Thanks in advance for any ideas.
-
14 Mar 2011 10:09 AM #2
How about this:
Good luckCode:var myToolbar = new Ext.Toolbar({ dock: 'top', items: [{ iconCls: 'my-toolbar', text: 'Google!', handler : function(){ document.location = "http://www.google.com"; } }] });
-
14 Mar 2011 11:27 AM #3
Hello crysfel -
...actually - sort of.
Some things about my app complicate the provided solution:
- The app is actually linking to a netflix.com url.
- The app is meant to be run from an iPad.
- The app is instantiated from an icon on the iPad "home screen".
This works just fine as long as the app is not started from the "home screen".
If I run the application by going to it in Safari - the "document.location = "http://www.netflix.com/WiPlayer?movieid=123456789" solution works. From the "home screen" however, I get a funky error message from the target server. The target url renders up to a point - then presents an alert message that it "Cannot open [home screen icon name here]".
These are all details I should have provided in the beginning. Sorry about that. It was well before my daily allotment of coffee.
-
18 May 2012 1:41 AM #4
add link button
add link button
how to add link button in grid column.
Similar Threads
-
Link Button or Hyper link
By nikhilwalker in forum Ext 2.x: Help & DiscussionReplies: 69Last Post: 24 May 2013, 5:13 AM -
No xtype for a link (anchor)?
By alphadogg in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 25 Nov 2010, 9:19 AM -
There's no xtype for a link (anchor)?!?
By alphadogg in forum Sencha Touch 1.x: DiscussionReplies: 1Last Post: 12 Nov 2010, 5:25 AM -
Anchor textfield in toolbar
By Adversus in forum Ext 2.x: Help & DiscussionReplies: 5Last Post: 27 Aug 2008, 8:40 AM -
TabPanel activate IE7 error --- Anchor name link FF2 scrolls whole page
By millenovecento in forum Ext 2.x: Help & DiscussionReplies: 5Last Post: 31 Jul 2008, 5:37 PM


Reply With Quote