Hello,
I have a inplace editor with autocomplete model. I want to set a custom item template.
If I set the model like this:
inPlaceEditorModel = {
dataSource: this.parentComponent.autoComplete.currentRecords,
fields: this.parentComponent.autoComplete.itemFkFields,
showPopupButton: true,
highlight: true,
allowCustom: false,
filtering: (e) => this.parentComponent.onFiltering(e),
headerTemplate: this.field.createForm? '<button class="e-btn e-icon-btn e-flat create-new-on-fly-btn" id="headerButton"><span class="material-icons icon-plus"></span><span>Ajouter un nouvel élément</span></button>' : '',
itemTemplate: `<div class="autocomplete-list-item-title">{{ data.title }}</div>
<div *ngIf="field.subProperties" class="autocomplete-list-item-details">
<span *ngFor="let subProperty of field.subProperties; let i = index">
<span>{{
data[subProperty.name]
| formatValue : subProperty.type : subProperty.lookupFamily
| async
}}</span>
<span *ngIf="field.subProperties[i + 1]"> • </span>
</span>
</div>`,
open: (args: any) => {
const headerButton = document.getElementById('headerButton');
if (headerButton) {
const self = this;
headerButton.addEventListener('click', (e: MouseEvent) => {
self.parentComponent.openNewForm();
});
}
}
};
It doesn't compile the template and give this result:
How can I setup a custom template?
Thanks,
Regards,
Matt