2

我正在尝试在海边 2.9 中做这样的事情

html button 
 onClick: (html jQuery ajax
  serialize: (html jQuery this);
  script: [:s | s << (s jQuery id: stratId) append: [html text: 'bing'. html break]]);
 callback: [2 inspect];
with: 'add option'.

正如我所期望的那样,我的带有 stratId 的 div 被附加了,但我的吱吱声图像中没有得到检查窗口?这样做的正确方法是什么?

4

1 回答 1

5

答案在 JQueryInstance>>#serializeThis 的方法注释的第二部分:

"Serialize the receiving element. Note that this might not work for all form elements: (1) for check-boxes and multi-select lists Seaside internally depends on an additional hidden form element that is generated automatically, instead use #serializeThisWithHidden (2) submit-button callbacks are ignored, instead use a normal callback to trigger specific code evaluation."

而是将您的回调代码放入 jQuery 回调本身,也就是 #script: 块。

于 2009-03-24T23:43:07.543 回答