我正在尝试向上滑动包含表格的 div,使用 ajax 调用更改表格的行,然后向下滑动包含表格。我似乎无法让一系列回调有效地工作。
$("div#grid").slideUp('fast', function() {
//eaery row but the first
$("#testtable tr")
.not(":first")
.filter(":has(input[type='checkbox'][checked])")
.each(function() {
//change html using ajax calls
editrow($(this).attr("id"));
});
})
.slideDown('fast'); // want this to wait until editrow() has been run on each row
editrow() 包含用于编辑给定行的 html 的 ajax 调用。问题是 div 向上滑动,然后立即向下滑动。我需要它等到函数在每一行上执行,更改表的 html,然后再将其向下滑动。