public data: Object[] = [
{
"text": "Hennessey Venom",
"id": "list-01",
"htmlAttributes": { draggable: true }
}
] |
dropHandler() {
var value = '<span id=' +"'" + this.uuidValue +"'" + ' class="e-chip-list" style="display:inline" contenteditable="false"> <span class="e-chip"> <span class="e-chip-text"> ' + text + '</span><span class="e-chip-delete e-dlt-btn"></span></span> </span>';
this.rteObj.executeCommand('insertHTML', value);
var deleteBtn = e.target.querySelector('#' + this.uuidValue + ' ' + '.e-chip-delete');
if (deleteBtn) {
deleteBtn.addEventListener('click', this.remove.bind(this, deleteBtn));
}
}
remove(deleteBtn) {
deleteBtn.closest('.e-chip-list').remove();
}
|