budibase icon indicating copy to clipboard operation
budibase copied to clipboard

Enable On-Click sorting in tables with external data sources

Open mikesealey opened this issue 1 year ago • 5 comments

Describe the feature request Feature Request from customer: Currently the old and new table components do no expose what column has been clicked on for sorting and do not allow us to disable user column sorting.

As we are using MSSQL queries we must rebuild the pagination ourselves which works but will provide in-correct sorting if the user clicks on a column header as its only sorting with the initial page of data the query returned. Ideally if we can capture either via a variable or via the table component outputs, the column name that has been sorted and its sort order we can pass these into our queries to perform the sort within the query itself.

Which boils down to

  1. Create settings toggle for the ability for the user to sort a table
  2. Surface the clicked-column to bindings for custom pagination sorted by column.

mikesealey avatar Jul 12 '24 12:07 mikesealey

Do you know if this referring to the old table or the new table? I suppose they could use a custom paginated query with either, but this sounds more like the old table with explicit pagination to me, as opposed to the new table with endless scroll.

aptkingston avatar Jul 15 '24 07:07 aptkingston

@aptkingston Customer that suggested it is indeed using the old table.

mikesealey avatar Jul 15 '24 08:07 mikesealey

If this is the old table, its unlikely to receive any updates as its deprecated.

The new table has sorting, so I'm going to close this.

ConorWebb96 avatar Jul 16 '24 07:07 ConorWebb96

Sorry this happens on both the old and new table, if using a custom query there is no way to tell the query what table header has been selected for sorting (via the user UI) and the sort order of the heading.

If you have built custom pagination into your query, then the sorting no longer works.

Is the recommendation now for the new table component, to not put return limits on the query and just utilise the endless scrolling, would there be any performance considerations with that?

benaunt avatar Jul 16 '24 23:07 benaunt

This issue has been automatically marked as stale as there has been no activity for 6 months.

github-actions[bot] avatar Jan 20 '25 13:01 github-actions[bot]