Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Last active November 17, 2020 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YonatanKra/ce8d0578469b1c06a98d48f62192f8ec to your computer and use it in GitHub Desktop.
Save YonatanKra/ce8d0578469b1c06a98d48f62192f8ec to your computer and use it in GitHub Desktop.
refreshData(data, clear = false) {
if (!clear) {...} else {...}
data.forEach(datum => {
const element = document.createElement('data-table-row');
element.setAttribute('name', datum.name);
element.setAttribute('id', datum.id);
element.setAttribute('email', datum.email);
this._dataTable.prepend(element);
});
DataApp.emitEvent(this, 'refreshed-data', {
scrollHeight: this._dataTable.scrollHeight
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment