任何人都可以确认 HTML 小部件在服务器端接受 ClickHandlers 吗?我无法让我的下面的代码工作。
我创建了一个 serverHandler(为了更好地衡量,我什至添加了一个无用的回调元素)。随后,我将它添加到 HTML.addClickHander 中(为了更好的衡量,我什至也将它添加到了 .addMouseUpHandler 中)。该函数未执行。
var mouseclick = app.createServerHandler("handleTrainingClick_").addCallbackElement(lstFilter);
var params = [ "fromOrg", "trainingTitle", "dueDate", "medical", "status" ];
var resultSet = blSelectActiveTrainings_();
while (resultSet.hasNext()) {
var training = resultSet.next();
var html = TRAINING_ROW;
for (var pI in params) {
html = html.replace("$"+params[pI], training[params[pI]]);
}
pnlList.add(app.createHTML(html).setId(training.id).addClickHandler(mouseclick).addMouseUpHandler(mouseclick)
.addMouseMoveHandler(mousemove).addMouseOutHandler(mouseout).addMouseOverHandler(mouseover));
}
function handleTrainingClick_(e) {
Logger.log(e.source);
var app = UiApp.getActiveApplication();
return app;
}