Hi Sathya,
Good day to you.
We have validated your query. Please find the validation details in below,
Query-1: Console error when edit dialog is opened in grid
We checked your query – “” and suspect you might be facing this issue due to specifying wrong element id for focusing the input element. In the ng-template we have specified the form elements to be rendered when the edit dialog is opened. Please find the code example in below,
Code example:
<ng-template #editSettingsTemplate let-data>
<div class="e-float-input e-control-wrapper" [ngClass]="{'e-error': CustomerID.invalid && (CustomerID.dirty || CustomerID.touched)}">
<input [(ngModel)]="orderData.CustomerID" required id="CustomerID"name="CustomerID" type="text" #CustomerID="ngModel">
<span class="e-float-line"></span>
<label class="e-float-text e-label-top" for="CustomerID">Customer Name</label>
</div>
</ng-template> |
And based on the input element id we have focused it in the actionComplete event.
actionComplete(args: DialogEditEventArgs): void {
if((args.requestType === 'beginEdit' || args.requestType === 'add')) {
args.form.ej2_instances[0].rules = {};
if (args.requestType === 'beginEdit') {
// Set initial Focus
(args.form.elements.namedItem('CustomerID') as HTMLInputElement).focus();
}
}
} |
So please ensure if you have specified the correct input element id to be focused in the actionComplete event.
We have prepared a sample for your reference. You can find it below,
Query-2: console error is: Cannot read property 'element' of undefined
We were unable to reproduce the reported issue and we suspect that the reported issue may be caused due to adding the new item using an external button click action.
We have prepared the sample and attached it below.
Please check the above sample and still issue persists, revert us with issue reproducing sample or modify the shared sample to reproduce a reported issue that will help us to check and provide the exact solution.
Regards,
Narayanasamy P.