obj*_*son 10 popup kendo-ui kendo-grid
firefox浏览器中的错误如下:TypeError:r未定义
这是chrome浏览器:Uncaught TypeError:无法读取undefined的属性'data'
我还制作了一个视频,以便更好地理解.
当我更改字段中的值时发生错误
按钮代码更新
save: function (e) {
var that = this;
$.ajax({
url: '/api/apdevice',
type: e.model.id == null ? 'POST' : 'PUT',
contentType: 'application/json',
data: JSON.stringify(e.model),
success: function (data) {
alert('yes');
that.refresh();
},
error: function (data) {
alert('no');
that.cancelRow();
}
});
}
Run Code Online (Sandbox Code Playgroud)
原因是您的数据源的更新方法被调用。尚未设置为您提供TypeError.
您可以做两件事之一。
这是方法#2 的示例。
var dataSource = new kendo.data.DataSource({
..
update: function(e) { return true; }
..
});
Run Code Online (Sandbox Code Playgroud)
保持保存事件功能不变。
请注意,我收到错误Uncaught SyntaxError: Unexpected number。我相信这源于LastClientsCount财产。
小提琴: http: //jsfiddle.net/mSRUe/23/