Smart UI Components & Libraries – Grid, Scheduler, Gantt, Kanban for Angular, React, Next.js, Vue, Blazor, JavaScript › Forums › Table › Would love to hear thoughts on: Table. › Reply To: Would love to hear thoughts on: Table.
August 6, 2025 at 9:43 am
#112820
Keymaster
Hi,
The simplest way is:
<smart-table id="table"></smart-table>
<script>
const table = document.getElementById('table');
// Initial data
let data = [
{ id: 1, name: 'Alice', age: 25 },
{ id: 2, name: 'Bob', age: 30 }
];
table.dataSource = data;
// Listen for changes
table.addEventListener('endEdit', (event) => {
const { row, dataField, value } = event.detail;
// Update the external model
data[row][dataField] = value;
console.log('Updated data:', data);
});
</script>
By handling the endEdit event and syncing with the data source.
Best regards,
Markov
Smart UI Team
https://www.htmlelements.com/