Hi,
In my .ts file I would like to use EditTemplateDirective; so, I put it there and Visual Studio imported it from "@progress/kendo-angular-grid/dist/es2015/editing/edit-template.directive". Although, Typescript compiler was happy with that, Kendo Grid was not working; it seemed Kendo Grid is using a different EditTemplateDirective. I changed the path for import to "@progress/kendo-angular-grid/dist/es/editing/edit-template.directive", and my guess was correct. Kendo Grid was happy with this import. However, Typescript compiler does keeps throwing compiler error for EditTemplateDirective, seems does not recognise that.
I noticed the same story is true for CommandColumnComponent. So, what is the problem there?
Thanks,
Mojaba
5 Answers, 1 is accepted
0
Hello Mojtaba,
Indeed not all types, needed for various Grid functionalities are exposed for importing from the main Grid package (@progress/kendo-angular-grid) directly - the recommended approach. The EditTemplateDirective is designed to be used as an attribute/directive, as opposed to being instantiated or referenced as type, e.g.:
... and the CommandColumnComponent - in the Grid markup via its selector, e.g.:
Can you please elaborate in a bit more details what necessitates importing these types and referencing them in code, so we can consider exposing them or trying to provide an alternative solution based on the specific use case? Thank you in advance.
Regards,
Dimiter Topalov
Progress Telerik
Indeed not all types, needed for various Grid functionalities are exposed for importing from the main Grid package (@progress/kendo-angular-grid) directly - the recommended approach. The EditTemplateDirective is designed to be used as an attribute/directive, as opposed to being instantiated or referenced as type, e.g.:
<
kendo-grid-column
field
=
"ProductName"
title
=
"Name"
width
=
"200"
>
<
ng-template
kendoGridEditTemplate
let-column
=
"column"
let-formGroup
=
"formGroup"
let-isNew
=
"isNew"
>
...
... and the CommandColumnComponent - in the Grid markup via its selector, e.g.:
<
kendo-grid-command-column
title
=
"command"
width
=
"220"
>
<
ng-template
kendoGridCellTemplate
let-isNew
=
"isNew"
>
<
button
kendoGridEditCommand [primary]="true">Edit</
button
>
<
button
kendoGridRemoveCommand>Remove</
button
>
<
button
kendoGridSaveCommand [disabled]="formGroup?.invalid">{{ isNew ? 'Add' : 'Update' }}</
button
>
<
button
kendoGridCancelCommand>{{ isNew ? 'Discard changes' : 'Cancel' }}</
button
>
</
ng-template
>
</
kendo-grid-command-column
>
Can you please elaborate in a bit more details what necessitates importing these types and referencing them in code, so we can consider exposing them or trying to provide an alternative solution based on the specific use case? Thank you in advance.
Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
0
0
0
Hello Mojtaba,
Thank you for providing further context. I logged an enhancement issue for making the Grid CommandColumnComponent available for import that you can track here:
https://github.com/telerik/kendo-angular/issues/1942
Meanwhile, you can use a regular Grid column with the required command buttons within the template, e.g.:
https://stackblitz.com/edit/angular-h4m7ns?file=app/app.component.ts
I hope this helps.
Regards,
Dimiter Topalov
Progress Telerik
Thank you for providing further context. I logged an enhancement issue for making the Grid CommandColumnComponent available for import that you can track here:
https://github.com/telerik/kendo-angular/issues/1942
Meanwhile, you can use a regular Grid column with the required command buttons within the template, e.g.:
https://stackblitz.com/edit/angular-h4m7ns?file=app/app.component.ts
I hope this helps.
Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.