Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
hughess committed Oct 13, 2024
1 parent 355c442 commit 8512eb3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<Story name="With Sort">
{@const data = Query.create(`SELECT * from flights LIMIT 1000`, query)}
<DataTable {data} sort="fare desc"/>
<DataTable {data} sort="fare desc" />
</Story>

<Story name="With Search">
Expand Down Expand Up @@ -55,13 +55,7 @@
`SELECT * from flights where regulator in ('Afghanistan', 'Belgium', 'Canada', 'Denmark') limit 50`,
query
)}
<DataTable
{data}
title="Flights"
search
groupBy="regulator"
groupsOpen="false"
>
<DataTable {data} title="Flights" search groupBy="regulator" groupsOpen="false">
<Column id="id" title="ID" />
<Column id="airline" title="Airline" />
<Column id="departure_airport" title="Departure Airport" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@
sortObj.ascending = true;
}
sortFunc(sortObj)
}
sortFunc(sortObj);
};
$: sortFunc = (sortObj) => {
const column = sortObj.col;
Expand Down
7 changes: 6 additions & 1 deletion sites/docs/pages/components/data-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ sidebar_position: 1

```orders_summary
select * from needful_things.orders
order by id
limit 100
```

Expand Down Expand Up @@ -113,7 +114,11 @@ This example includes a `custom_format` column, which contains a different curre
<Column id=sales fmt=usd/>
</DataTable>


<DataTable data={orders_summary} sort="sales asc">
<Column id=category/>
<Column id=item/>
<Column id=sales fmt=usd/>
</DataTable>

### Deltas

Expand Down

0 comments on commit 8512eb3

Please sign in to comment.