简体   繁体   中英

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

im trying to add new row in Kendo Grid with following settings:

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

And editable set to:

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

But after the click on the "Add new row " button i always get following error 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

Could it be caused value in column?

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

Thanks for any advice.

Can you try this?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM