PDA

View Full Version : Ext.Router and Google Maps infoWindows



fsjay
8 Jun 2011, 7:56 AM
Hi,

I am new to Sencha Touch and was hunting through the examples on how to call an event from an url. I want to have a hyperlink within an infoWindow that will open a panel. I've seen posts on Ext.Router that mat be the solution but have no idea how to implement this.

Any help would be appreciated.

Thanks.

steve1964
8 Jun 2011, 8:19 AM
Hi, try with event delegation:
http://www.sencha.com/blog/event-delegation-in-sencha-touch/

fsjay
8 Jun 2011, 10:04 AM
Thanks, but I just need one link per panel not a list of child links like the example.

steve1964
8 Jun 2011, 1:44 PM
You can delegate in this way:

1. in the info windows set a div for the link, for example <div class="link"><a href="..."></div>
2 set a listener for your map:


listeners: {
body: {
click: myHandler,
delegate: 'link';
}
}

where myHandler is a function, in your case in this function you can setup your panel.

fsjay
9 Jun 2011, 6:21 AM
Great, then where do I put my code that executes from that click?

thanks

fsjay
9 Jun 2011, 6:29 AM
Nevermind...dumb question :)

fsjay
9 Jun 2011, 7:26 AM
Still doesn't work....Doesn't execute my function.

fsjay
9 Jun 2011, 7:29 AM
Even just put it in declaration:

<a class = "link" href = "">

body:{
click: function(e) {
if (e.getTarget('link')) {
alert('hello');
}
},
delegate: 'link'
},