我的ajax函数是
//my grid initialization is here
mygrid.init();
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WeeklyReportConfig.aspx/Showdata",
data: '{"idno":"' + emid + '"}',
dataType: "json",
success: function(result) {
for (var i = 0; i < result.d.length; i++) {
result = JSON.stringify(result[i]);
mygrid.load(result[i], JSON);
}
},
error: function(result) {
alert("Error");
}
});
我无法加载我的 dhtmlx 网格,但我正在从我的 Web 方法获取数据。
最佳答案
在ajax方法中添加async: false。
关于javascript - 如何从ajax响应加载dhtmlx网格中的数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46052253/