# Allowing visitors to sort rows in data table

**URL:** <https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056>\
**Category:** Ask for Help\
**Created:** [December 26, 2022, 10:27am UTC](https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056 "2022-12-26T10:27:47Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![amessios](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amessios/32/52096_2.png) [@amessios](https://community.glideapps.com/u/amessios)\
**Post date:** [December 26, 2022, 10:27am UTC](https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056/1 "2022-12-26T10:27:47Z")

</div>

Hi,

Is there any way to allow visitors to sort the rows in a data table? e.g., sorting A\>Z by name column, or largest to smallest in a numerical column.

Here’s my project: [MP Second Job Scanner](https://mp-second-job-scanne-3vkx.glide.page/dl/d0a5f4)

Best,  
Andrew

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 26, 2022, 10:38am UTC](https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056/2 "2022-12-26T10:38:21Z")

</div>

Unfortunately the Data Grid doesn’t support dynamic sorting at the moment (hopefully it will soonish).

For now, a somewhat clunky workaround would be to add multiple data grid components with each having a different sort setting, and then control the visibility of each via a choice component that writes to a User Specific Column. Just be aware that this approach can very quickly eat into your update quota, as each “click” would be counted as an update.

---

<div class="post-metadata">

**Author:** ![amessios](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amessios/32/52096_2.png) [@amessios](https://community.glideapps.com/u/amessios)\
**Post date:** [December 26, 2022, 11:09am UTC](https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056/3 "2022-12-26T11:09:27Z")

</div>

Hi Darren,

Thank you for the speedy response! 🙂

I have a couple of other questions:

- Can you extend the number of columns visible on a page? Right now it seems capped at 50 before it creates a new page.
- Can you click through a row on a data grid which will take you to a new page (presented as a card preferably) which will show data from a different data source (i.e., another spreadsheet).

Best,  
Andrew

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 26, 2022, 11:45am UTC](https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056/4 "2022-12-26T11:45:08Z")

</div>

> [@amessios](#):
>
> Can you extend the number of columns visible on a page? Right now it seems capped at 50 before it creates a new page.

Columns, or rows?  
I’m not aware of any limits on either, but there might be. But 50 columns in a data grid seems excessive and would mean lots of horizontal scrolling, which doesn’t make for a very good user experience.

> [@amessios](#):
>
> Can you click through a row on a data grid which will take you to a new page (presented as a card preferably) which will show data from a different data source (i.e., another spreadsheet).

Unfortunately, no. The data grid component does not support item actions.

Personally, I’d be inclined to use either a List or Table collection, and just display a handful of attributes for each item. Then use the default item action to show a details screen for each item. If you have 50+ attributes for each item, what you could is construct a HTML table with two columns (attribute/value) and display in a Rich Text component on each items detail screen. I think this would be a better user experience as any scrolling would be vertical rather than horizontal.

---

<div class="post-metadata">

**Author:** ![amessios](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amessios/32/52096_2.png) [@amessios](https://community.glideapps.com/u/amessios)\
**Post date:** [December 26, 2022, 12:50pm UTC](https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056/5 "2022-12-26T12:50:18Z")

</div>

Apologies - I meant rows. It seems capped at 25 per page (see image) - and, ideally, I’d have all of the rows on one single page.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/2/f2b48996d49d65630006caf9567640b7a9260028.png)

Thanks for your advice on the data grid. I’ll try that.

Best,  
Andrew

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 26, 2022, 1:12pm UTC](https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056/6 "2022-12-26T13:12:13Z")

</div>

You can adjust the page size under options.

 ![Screen Shot 2022-12-26 at 9.10.33 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/6/76185ba6223258eb47a5a14960cf5c513144cc7d.png)

Default is 24, but I think you can set it to whatever you like. Certainly 50 or 100 should be no problem at all.

---

<div class="post-metadata">

**Author:** ![amessios](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amessios/32/52096_2.png) [@amessios](https://community.glideapps.com/u/amessios)\
**Post date:** [December 26, 2022, 1:37pm UTC](https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056/7 "2022-12-26T13:37:31Z")

</div>

Ah, missed that - thank you!

---

<div class="post-metadata">

**Author:** ![amessios](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amessios/32/52096_2.png) [@amessios](https://community.glideapps.com/u/amessios)\
**Post date:** [December 27, 2022, 9:37am UTC](https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056/8 "2022-12-27T09:37:43Z")

</div>

Hi @Darren_Murphy - If you don’t mind, I have a couple of other questions (I don’t want to spam the forum with noob questions 😅).

- Can you change the default column width? Some of [my columns](https://mpsecondjobs.uk/dl/a400f7) are wider than I want them to be, and some are narrower. They’re obviously adjustable for the user, but I’d like to be able to have some control how they appear by default.

- Is there a way to add additional filters? On [this page](https://mpsecondjobs.uk/dl/a400f7) I’ve added a filter for political party, but I’d also like visitors to be able to filter the data grid by other fields (e.g., Region).

Much appreciated for your help so far.

Best,  
Andrew

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 27, 2022, 10:57am UTC](https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056/9 "2022-12-27T10:57:13Z")

</div>

> [@amessios](#):
>
> Can you change the default column width? Some of [my columns](https://mpsecondjobs.uk/dl/a400f7) are wider than I want them to be, and some are narrower. They’re obviously adjustable for the user, but I’d like to be able to have some control how they appear by default.

I’m afraid not. What you see is what you get. I think Glide does it’s best to auto-size the columns based on the data, but I agree it would be nice if you could set default column widths.

> [@amessios](#):
>
> Is there a way to add additional filters? On [this page](https://mpsecondjobs.uk/dl/a400f7) I’ve added a filter for political party, but I’d also like visitors to be able to filter the data grid by other fields (e.g., Region).

Not out of the box, but it’s possible to create your own custom filters. Here’s a tutorial that shows how to do that:

> [@tornado Use Multiple Choice Components to Filter an Inline List](https://community.glideapps.com/t/use-multiple-choice-components-to-filter-an-inline-list/16932):
>
> [[Glide: Filter an Inline List with Choice Components] ](https://www.youtube.com/watch?v=NOYFsVUWQXw) Updated July 2022 
> 
> > **Version 1**
> >
> > \<a href="https://www.youtube.com/watch?v=rtbFccDKuH0"\>https://www.youtube.com/watch?v=rtbFccDKuH0\</a\>

Bob’s tutorial uses a Glide App, but similar techniques can be applied to any list/collection in either Apps or Pages.

My earlier note about the impact on updates would also apply in this case:

> [@Darren\_Murphy](#):
>
> Just be aware that this approach can very quickly eat into your update quota, as each “click” would be counted as an update.

---

<div class="post-metadata">

**Author:** ![amessios](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amessios/32/52096_2.png) [@amessios](https://community.glideapps.com/u/amessios)\
**Post date:** [December 27, 2022, 12:16pm UTC](https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056/10 "2022-12-27T12:16:32Z")

</div>

Great, thanks again @Darren_Murphy .

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [December 28, 2022, 12:17pm UTC](https://community.glideapps.com/t/allowing-visitors-to-sort-rows-in-data-table/56056/11 "2022-12-28T12:17:30Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
