2011-04-12 53 views

回答

1
new Ext.Button({ 
    text: 'PRESS ME', 
    handler: function() { 
    window.open('http://textfiles.com/or/spreadsheet.xls', '_blank'); 
    } 
}); 
在处理

或可能window.location = http://somewhereelse.com/anotherfile.txt '如果你不想打开一个新窗口。

1

我使用Ext.LinkButton(一个扩展名,你必须添加你自己)Animal,它工作得很好。

它使用HTML<a href...>元素,因此它充当正常链接。由于浏览器可能会询问用户是否可以打开此弹出式菜单 - 由于使用了JavaScript方法,所以我在wombleton的解决方案中遇到了一些麻烦。

您还可以在stackoverflow的这里看到previous question的参考文献。