簡體   English   中英

Kendo GRID-單擊“添加新行”按鈕后,獲取kendo網格Uncaught TypeError:無法讀取“名稱”的屬性null

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

我試圖在Kendo Grid中使用以下設置添加新行:

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"
              },

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM