剑道网格 - 单击“添加新行”按钮后,获取剑道网格未捕获的类型错误:无法读取“名称”空的属性

Kendo GRID - After the click on the "Add new row" button get kendo grid Uncaught TypeError: Cannot read property of 'name' null

本文关键字:网格 类型 错误 读取 属性 名称 获取 新行 添加 单击 添加新行      更新时间:2023-09-26

>im 尝试使用以下设置在剑道网格中添加新行:

costCategory: {
                editable: true,
                nullable: false,
                defaultValue: {},
                type: "object"
              },

可编辑设置为:

editable:{
        //mode: 'inline',
        //confirmation:false //remove delete confirm message
      },

但是在单击"添加新行"按钮后,我总是收到以下错误消息;

Uncaught TypeError: Cannot read property 'name' of null

Uncaught TypeError: Cannot read property 'name' of nullVM6703:3 (anonymous function)jquery.js:547 proxykendo.all.min.js:24 N.ui.DataBoundWidget.extend._rowsHtmlkendo.all.min.js:24 N.ui.DataBoundWidget.extend._renderContentkendo.all.min.js:24 N.ui.DataBoundWidget.extend.refreshjquery.js:547 proxykendo.all.min.js:9 n.extend.triggerkendo.all.min.js:11 ct.extend._processkendo.all.min.js:11 ct.extend._changejquery.js:547 proxykendo.all.min.js:9 n.extend.triggerkendo.all.min.js:10 ct.extend.splicekendo.all.min.js:11 ct.extend.insertkendo.all.min.js:23 N.ui.DataBoundWidget.extend.addRowkendo.all.min.js:23 (anonymous function)jquery.js:4641 jQuery.event.dispatchjquery.js:4309 elemData.handle

它会导致列中的值吗?

  {
          field :"costCategory.name",
          title : $translate.instant('COSTCATEGORY'),
          width: "200px",
          editor: GlobalHelperService.getCostCategoryForAutocomplete,
          filterable: {
            cell: {
              operator: "contains"
            }
          }
        },

感谢您的任何建议。

你能试试这个吗?

costCategory: {
                editable: true,
                nullable: false,
                defaultValue: {"name" : ""},
                type: "object"
              },