我有一个GWT演示项目,其中包含一个包含3列和5行的数据表。我用gwt来实现:
table.addTableListener( new TableListener(){
public void onCellClicked(SourcesTableEvents sender, int row, int cell) {
demoFunc();
}
});
如何创建html按钮并使用jquery调用“onCellClicked”事件。
<input type="button" id="button1" value="click here"/ >
...
$("#button1").click(function(){
//implement here to call "onCellClicked" event.
});
答案 0 :(得分:0)
看看gquery,一个GWT的jquery端口:http://code.google.com/p/gwtquery/ 尚未测试超出GWT 1.5。
否则你需要做一些JSNI,在JSNI标签中包装一个javascript函数,并使用GWT或者使用jQuery或者你想要的任何方式调用javascript。
请参阅文档:http://code.google.com/webtoolkit/doc/2.2/FAQ_Client.html