我有一个web方法可以将数据返回到代码的js端。我想绑定数据并将其显示在网格上。
function LoadData(){
var data = GetDataFromWebMethod();
if (data === undefined || data == null) {
$('#DisplayGrid').next().append('<span id="spnErr"> No Data.</span>');
}
else {
var configData = [];
configData.push({ label: "EmpName", name: 'EmpName', width: 300, sopt: ['cn'] });
configData.push({ label: "Dept", name: 'Dept', width: 300, sopt: ['cn'] });
}
function GetRelatedWorkitem() {
ajaxSync("POST", "/WebServices/Page.asmx/GetData", "application/json; charset=utf-8", "json", JSON.stringify({ Emp: name}), doneCallBack, failCallback);
return objData.Data;
}