-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak styles and add sorting/filtering examples
- Loading branch information
Showing
3 changed files
with
155 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -456,98 +456,127 @@ let hoverDelayMS = 1000; | |
const onHoverDelayMsInput = (event: Event) => { | ||
hoverDelayMS = Number.parseInt((event.target as HTMLInputElement).value, 10); | ||
}; | ||
let tableData = [ | ||
{ | ||
id: 1, | ||
first_name: 'Bobette', | ||
last_name: 'Dankov', | ||
email: '[email protected]', | ||
ip_address: '212.10.172.113', | ||
}, | ||
{ | ||
id: 2, | ||
first_name: 'Jack', | ||
last_name: 'Biaggelli', | ||
email: '[email protected]', | ||
ip_address: '147.246.244.8', | ||
}, | ||
{ | ||
id: 3, | ||
first_name: 'Dalli', | ||
last_name: 'Spain', | ||
email: '[email protected]', | ||
ip_address: '230.60.71.89', | ||
}, | ||
{ | ||
id: 4, | ||
first_name: 'Berte', | ||
last_name: 'Simonard', | ||
email: '[email protected]', | ||
ip_address: '249.139.115.176', | ||
}, | ||
{ | ||
id: 5, | ||
first_name: 'Desirae', | ||
last_name: 'Kondratyuk', | ||
email: '[email protected]', | ||
ip_address: '37.201.201.199', | ||
}, | ||
{ | ||
id: 6, | ||
first_name: 'Susannah', | ||
last_name: 'Ilchuk', | ||
email: '[email protected]', | ||
ip_address: '129.106.9.65', | ||
}, | ||
{ | ||
id: 7, | ||
first_name: 'Koren', | ||
last_name: 'Priditt', | ||
email: '[email protected]', | ||
ip_address: '133.252.171.244', | ||
}, | ||
{ | ||
id: 8, | ||
first_name: 'Silvano', | ||
last_name: 'Dell Casa', | ||
email: '[email protected]', | ||
ip_address: '100.135.33.162', | ||
}, | ||
{ | ||
id: 9, | ||
first_name: 'Jens', | ||
last_name: 'Darthe', | ||
email: '[email protected]', | ||
ip_address: '240.64.233.124', | ||
}, | ||
{ | ||
id: 10, | ||
first_name: 'Lynett', | ||
last_name: 'Brakewell', | ||
email: '[email protected]', | ||
ip_address: '235.217.168.168', | ||
}, | ||
]; | ||
const removeTableRow = () => { | ||
const [_, ...data] = tableData; | ||
tableData = [...data]; | ||
}; | ||
</script> | ||
|
||
<NotificationContainer /> | ||
|
||
<div class="container mx-auto my-4 flex flex-col gap-8 p-4"> | ||
<AgGridTable | ||
style="height: 500px" | ||
columnDefs={[ | ||
{ field: 'id', headerName: 'ID' }, | ||
{ | ||
field: 'first_name', | ||
headerName: 'First name', | ||
unSortIcon: true, | ||
comparator(valueA, valueB) { | ||
return valueA > valueB ? 1 : -1; | ||
}, | ||
}, | ||
{ | ||
field: 'last_name', | ||
headerName: 'Last name', | ||
unSortIcon: true, | ||
comparator(valueA, valueB) { | ||
return valueA > valueB ? 1 : -1; | ||
}, | ||
}, | ||
{ | ||
field: 'email', | ||
headerName: 'Email', | ||
unSortIcon: true, | ||
comparator(valueA, valueB) { | ||
return valueA > valueB ? 1 : -1; | ||
}, | ||
}, | ||
{ field: 'ip_address', headerName: 'IP address', filter: true }, | ||
]} | ||
rowData={tableData} | ||
options={{ | ||
defaultColDef: { | ||
flex: 1, | ||
}, | ||
columnDefs: [ | ||
{ field: 'id', headerName: 'ID' }, | ||
{ field: 'first_name', headerName: 'First name' }, | ||
{ field: 'last_name', headerName: 'Last name' }, | ||
{ field: 'email', headerName: 'Email' }, | ||
{ field: 'ip_address', headerName: 'IP address' }, | ||
], | ||
rowData: [ | ||
{ | ||
id: 1, | ||
first_name: 'Bobette', | ||
last_name: 'Dankov', | ||
email: '[email protected]', | ||
ip_address: '212.10.172.113', | ||
}, | ||
{ | ||
id: 2, | ||
first_name: 'Jack', | ||
last_name: 'Biaggelli', | ||
email: '[email protected]', | ||
ip_address: '147.246.244.8', | ||
}, | ||
{ | ||
id: 3, | ||
first_name: 'Dalli', | ||
last_name: 'Spain', | ||
email: '[email protected]', | ||
ip_address: '230.60.71.89', | ||
}, | ||
{ | ||
id: 4, | ||
first_name: 'Berte', | ||
last_name: 'Simonard', | ||
email: '[email protected]', | ||
ip_address: '249.139.115.176', | ||
}, | ||
{ | ||
id: 5, | ||
first_name: 'Desirae', | ||
last_name: 'Kondratyuk', | ||
email: '[email protected]', | ||
ip_address: '37.201.201.199', | ||
}, | ||
{ | ||
id: 6, | ||
first_name: 'Susannah', | ||
last_name: 'Ilchuk', | ||
email: '[email protected]', | ||
ip_address: '129.106.9.65', | ||
}, | ||
{ | ||
id: 7, | ||
first_name: 'Koren', | ||
last_name: 'Priditt', | ||
email: '[email protected]', | ||
ip_address: '133.252.171.244', | ||
}, | ||
{ | ||
id: 8, | ||
first_name: 'Silvano', | ||
last_name: 'Dell Casa', | ||
email: '[email protected]', | ||
ip_address: '100.135.33.162', | ||
}, | ||
{ | ||
id: 9, | ||
first_name: 'Jens', | ||
last_name: 'Darthe', | ||
email: '[email protected]', | ||
ip_address: '240.64.233.124', | ||
}, | ||
{ | ||
id: 10, | ||
first_name: 'Lynett', | ||
last_name: 'Brakewell', | ||
email: '[email protected]', | ||
ip_address: '235.217.168.168', | ||
}, | ||
], | ||
}} | ||
/> | ||
|
||
<Button on:click={removeTableRow}>Remove row</Button> | ||
</div> | ||
|
||
<div class="container mx-auto my-4 flex flex-col gap-8 p-4"> | ||
|