Hi,this code not fire complete event:
$(document).ready(function () {
var ds = new kendo.data.DataSource({
transport: {
read: {
url: "/api/Base/QueryData",
dataType: "json",
type: "post",
contentType: "application/x-www-form-urlencoded",
data: {
PrimaryTable: "Employee",
PrimaryKeyField: "EID",
FieldNameList: "EID,EmpName,sex",
ConditionExpr: "EID=85"
},
beforeSend: function (xhr) {
//xhr.setRequestHeader('Authorization', window.auth);
},
complete: function (jqXHR, textStatus) {
console.log(jqXHR);
}
}
}
});
$("#divQJList").kendoGrid({
dataSource: ds
});
});
the api/Base/QueryData code like this:
[Route("QueryData")]
public GRDataSet QueryData([FromBody]JObject jo)
{
GRDataSet grData = new GRDataSet();
grData.Table = new DBTable();
grData.Table.FieldList = new ObservableCollection<DBField>();
........
DataSet ds = GetData(jo);
grData.DataXML = XDocument.Parse(ds.GetXml());
return grData;
}
response return json:
{
"Table": {
"TableName": "DS",
"TableTypeID": 2,
"TableTypeName": 0,
"PrimaryKey": null,
"TableOrder": 1,
"TableLabel": "Employee Table",
"FieldList": [
{"TableName": "EMPLOYEE", "TableTypeId": 2, "ColName": "EID", "ColOrder": 10, "ColType": "INT IDENTITY", "ColWidth": 4, "ColPrecision": 0, "ColNull": 0, "ColDefault": "", "DisplayLabel": "ID" },
{"TableName": "EMPLOYEE", "TableTypeId": 2, "ColName": "EMPNAME", "ColOrder": 1, "ColType": "VARCHAR", "ColWidth": 20, "ColPrecision": 0, "ColNull": 0, "ColDefault": "", "DisplayLabel": "Name" },
{"TableName": "EMPLOYEE", "TableTypeId": 2, "ColName": "SEX", "ColOrder": 40, "ColType": "CHAR", "ColWidth": 1, "ColPrecision": 0, "ColNull": 1, "ColDefault": "", "DisplayLabel": "Sex" }
]
},
"DataXML": { "NewDataSet": { "DS": { "EMPLOYEE_EID": "85", "EMPLOYEE_EMPNAME": "系统管理员", "EMPLOYEE_SEX": "1" } } },
"Total": 10
}