BoldDesk®Customer service software offering ticketing, live chat, and omnichannel support, starting at $49/mo. for 10 agents. Try it for free.
Using the guideline provided in the documentation, while using the Edit Template, show the following error during Add a new record.
Thank you.
Hi, any updates? Thank you.
Regards.
Hi Rodrigo,
Greetings
from Syncfusion Support.
The script
error encountered in the edit template when adding a new record occurs because
the foreignKeyData property in the arguments is undefined. This property
contains a valid object only when editing a record, as the record already
exists in the dataSource with stored values. However, when adding a new record,
no prior data is available in the dataSource, as the record is created during
the add action. Consequently, foreignKeyData remains undefined, and any attempt
to access its properties results in the current issue.
To resolve
this, you can include a conditional check to verify whether foreignKeyData is
defined before accessing its values. Please refer to the modified code snippet
below:
[Views\Home\Index.cshtml]
function write (args) { // to show the value for custom component if (args.foreignKeyData) { var value = args.foreignKeyData[0][args.column.foreignKeyValue]; } autoComplete = new ej.dropdowns.AutoComplete({ dataSource: employeeData, fields: { value: args.column.foreignKeyValue }, value: value }); autoComplete.appendTo(args.element); }
|
Please let us
know if you require any further assistance.
Regards,
Santhosh I
Hi Santhosh, the solution provided works great.
Thank you.
Hi Rodrigo,
We are glad to hear that the provided solution was helpful. Please let us know if you require any further assistance.
Regards,
Santhosh I