Updated the models.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<script>
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
export let rows;
|
||||
export let columns;
|
||||
export let rowKey; //Must only be null/undefined if the row is a new object (not associated with a row in the table). Should not change.
|
||||
@@ -6,6 +8,8 @@
|
||||
export let actions;
|
||||
export let selection; //TODO: allow multiple selections? Make selections optional?
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
// Setup a width for each column.
|
||||
columns.forEach(column => {
|
||||
let min = column.minWidth ? Math.max(10, column.minWidth) : 10;
|
||||
@@ -72,6 +76,7 @@
|
||||
|
||||
selectedRowElement = element;
|
||||
element.classList.add('selected');
|
||||
dispatch('selection', selectedRowElement.dataset.key);
|
||||
}
|
||||
|
||||
// Edit row code.
|
||||
|
||||
Reference in New Issue
Block a user