使用POST请求时,网格未被过滤
loadData: function (filter) {
return $.ajax({
type: "POST",
url: "frmNewGroup.aspx/searchFilter",
data: JSON.stringify(filter),
contentType: "application/json; charset=utf-8",
success: function (data) {
console.log(data);
}
});
}
我们必须使用GET请求吗?
感谢。
答案 0 :(得分:3)
从ajax获取数据时,您错过了def.resolve(data);
。
loadData : function(filter) {
var def = $.Deferred();
$.ajax({
type: "POST",
url: "frmNewGroup.aspx/searchFilter",
data: JSON.stringify(filter),
contentType: "application/json; charset=utf-8",
}).done(function(data) {
console.log(data);
def.resolve(data);
});
return def.promise();
}