updateDroppedData throws error - unable to set property of undefined

Trying to get a very basic Kanban going to show which employees are assigned to which team.  Everything displays correctly, but when you drag an employee to another column, it throws an error of:

 constants.js:93 Uncaught TypeError: Cannot set property 'reportsTo' of undefined

    at e.updateDroppedData (constants.js:93)

    at e.<anonymous> (constants.js:93)

    at e.notify (constants.js:93)

    at t.e.trigger (constants.js:93)

    at e.dragStop (constants.js:93)

    at e.notify (constants.js:93)

    at t.e.trigger (constants.js:93)

    at t.intDragStop (constants.js:93)

 

The data is:

  var data = [{"id":"4","display_name":"jadoe","reportsTo":"0"}] 

The code is:

 var kanbanObj = new ej.kanban.Kanban({

        dataSource: data,

        keyField: 'reportsTo',

        columns: [

            { headerText: 'Employees', keyField: '0' },

            { headerText: "jdoe", keyField: "3" },{ headerText: "Juan De Tal", keyField: "5" },        ],

        cardSettings: {

            contentField: 'display_name'

        }

    });

    kanbanObj.appendTo('#Kanban');

 

Any thoughts?


3 Replies

RV Ravikumar Venkatesan Syncfusion Team April 20, 2020 12:30 PM UTC

Hi Mark, 

Greetings from Syncfusion support. 

We checked your reported issue that “updateDrappedData throws error”  with your shared codes we found the cause for the reported issue is that you have missed the cardSettings’s mandatory field as headerField. So we suggest you please use the below code snippet to overcome this issue. We have prepared a sample based on your requirement it can be available in below link. 

[index.js] 
cardSettings: { 
    contentField: 'EmployeeName', 
    headerField: 'Id' 
  } 



Kindly try the above sample and get back to us If you would require further assistance. 

Regards, 
Ravikumar Venkatesan 




MA Mark April 20, 2020 01:25 PM UTC

Doh!  That worked.  Very sorry for missing that.


VM Vengatesh Maniraj Syncfusion Team April 21, 2020 06:33 AM UTC

Hi Mark, 

No problem. We are happy that your problem has resolved. 

Please get in touch with us if you need any further assistance. 

Regards, 
Vengatesh 



Loader.
Up arrow icon