默认情况下,我需要在编辑模式下将空的最后一行添加到 Kendo UI 网格。我正在从 api 获取数据,如果我尝试最后添加空行,它首先被调用,然后 api 被调用。我该怎么做。我不想设置超时。我尝试在数据源中添加空记录,但为此我需要做很多事情
var dataSource = new kendo.data.DataSource({
type: "odata",
serverPaging: false,
serverSorting: false,
serverFiltering: false,
//pageSize: 20,
schema: {
data: function (data) {
var resultData = [];
if (data.value != null && data.value[0].Payload != null && data.value[0].Payload != "[]")
resultData = JSON.parse(data.value[0].Payload);
return resultData;
},
total: function (data) {
var length = 0;
if (data.value != null)
length = data.value[0].PayloadCount;
return length;
},
model: {
id: that.gridProperties.PrimaryKeyName,
fields: that.gridProperties.Schema
}
},
change: that.onGridDataChanged,
transport: {
read: {
url: that.gridProperties.DataSourceURL,
contentType: "application/json; charset=utf-8",
type: "GET",
dataType: "json"
}
}
});
慕标5832272
临摹微笑
相关分类