PDA

View Full Version : How invoke url from ext js 4 component.



bryan10
27 Jan 2012, 2:26 AM
Hello, I would like to be able to invoke a url following a user selecting
an ext js component (i.e. following user clicking on ext js button, toolbar,
treepanel item, menu item). How can this be done? In html one can do
<a href=url> for a link. (it's probably a simple question... but I'm not sure
how it's done)


Thank you,
Bryan

Farish
27 Jan 2012, 3:54 AM
You could use


window.open(URL,name,specs,replace)

on the handler of the component. e.g. you could use this on the handler of your button and on click, it would open the url.

börn
27 Jan 2012, 4:16 AM
if the component (e.g. a button) has a handler property, you can configure a function which makes a document.location.href = 'yoururl'.

alternatively you can make html: '<a href...' or you use tpl - a extjs template with an <a href...>... i prefer the latest, because the "components" behave like a html link and the user can bookmark the target.