appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Feature]-[800]:Server-side filtering for Tables

Open lublak opened this issue 3 years ago • 28 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Summary

Binding of the data from the Filter fields to the data sources.

Why should this be worked on?

Currently, the filtering is client-side. Especially with large amounts of data, I use serverside pageination. But now it would be practical to integrate the data in sql as with serverside pagination. Table.filterJson next to Table.search and Table.pageNo would be really nice.

Front logo Front conversations

lublak avatar Jan 19 '22 12:01 lublak

@lublak sort is already available. You can bind {{Table1.sortOrder.column}}. Server-side filtering is still missing today

Nikhil-Nandagopal avatar Jan 24 '22 10:01 Nikhil-Nandagopal

@lublak this might be possible today even on the server side using the onSort event, which can be used to call an api, We also have an internal property {{Table1.sortOrder}} which gives you the column name and the order in which the user is asking you to sort, this is set to null when no column is set on sort.

Screenshot 2022-01-24 at 4 21 03 PM

@Nikhil-Nandagopal do you think this solves the problem? This is not well documented though. cc @Pranay105 @dilippitchika

somangshu avatar Jan 24 '22 10:01 somangshu

@somangshu it does but the same needs to be possible for filters as well

Nikhil-Nandagopal avatar Jan 24 '22 11:01 Nikhil-Nandagopal

@Nikhil-Nandagopal agreed, we have an open issue for that, not yet prioritised, we might be able to get it up once we have the v2 for table. Though in no way this is dependent on the v2 implementation.

somangshu avatar Jan 24 '22 11:01 somangshu

@Tooluloope I remember you working on the earlier feature set, Any comments on this, What is the effort required? Did we push this back for a reason?

somangshu avatar Jan 24 '22 11:01 somangshu

Yes for sorting there is it available (but are we missing the serverside switch like the serverside pagination to disable all client side searching?) Filtering is still completely missing.

lublak avatar Jan 26 '22 15:01 lublak

Hey @lublak could you expand on the switch part? You have events called onSearchTextChanged and onSort.

If you bind a query to it, it will be triggered with the events making it server side, if you don't it will be done on the client side. Is this part of the table events unclear?

Agreed on the filtering part.

dilippitchika avatar Jan 27 '22 05:01 dilippitchika

@dilippitchika firefox_AmE1SbxE8Q the Sort switch is also missing

Or "Enable client side sort"

lublak avatar Jan 27 '22 20:01 lublak

Hey @lublak the reason we have "Server side Pagination" as a switch is because it needs extra properties for it to be configured and used.

For server side sort, we don't have a switch because once you configure the onSort action to bind to a query it is server side sort. You don't need an extra switch for it. When there is no query bound to onSort it uses client side sort.

The switch is only needed for server side if there are some extra properties which are needed to be filled.

dilippitchika avatar Jan 28 '22 05:01 dilippitchika

@dilippitchika and what about "Enable client side search"? Why is this needed?

lublak avatar Jan 28 '22 15:01 lublak

@lublak that is used to disable the client-side search when server-side search is applied way so that the client-side does not override the server-side search

Nikhil-Nandagopal avatar Jan 31 '22 06:01 Nikhil-Nandagopal

@lublak Here's the issue to understand why we added the property https://github.com/appsmithorg/appsmith/issues/5444

Tooluloope avatar Jan 31 '22 06:01 Tooluloope

Today, we already expose all the filter properties using Table1.filters, we need to add a new onFilterUpdate action to support this.

dilippitchika avatar Jan 31 '22 07:01 dilippitchika

@Nikhil-Nandagopal @Tooluloope thanks for the answer :) i understood now. It's just a bit confusing when it's there for searching and not for sorting. I'm sorry I didn't understand it right away.

lublak avatar Jan 31 '22 08:01 lublak

@dilippitchika in case there is enough clerity here with what needs to be implemented, Please move this to the backlog and unassign yourself

somangshu avatar Feb 09 '22 07:02 somangshu

Action desired behavior for this feature

  1. Add .filters into the autocomplete for users to know it can be accessed.
  2. Add a new onFilterUpdate which detects the changes made in the filters and triggers this action.

@somangshu now that we have 2 versions of tables how to uptake this change?

dilippitchika avatar Feb 25 '22 07:02 dilippitchika

Should this be moved to Table WIdget V2 or remain in Enhancement?

Tooluloope avatar Feb 28 '22 09:02 Tooluloope

Will check and get back tomorrow, @Tooluloope

dilippitchika avatar Feb 28 '22 12:02 dilippitchika

@Tooluloope we should do this in V1 as well, checked with @sbalaji1192. Please discuss with him before picking it up.

dilippitchika avatar Mar 01 '22 12:03 dilippitchika

@dilippitchika considering the previous discussion, can you drop the summary here and add what is required to resolve the actionable, We will resolve this internally.

Action desired behavior for this feature

  • Add .filters into the autocomplete for users to know it can be accessed.
  • Add a new onFilterUpdate which detects the changes made in the filters and triggers this action.

somangshu avatar Mar 31 '22 09:03 somangshu

[Updated requirements]

Action desired behavior for this feature

  • Add .filters into the autocomplete for users to know it can be accessed.

  • Use the "Enable client side search" switch to show/hide another event described below. Rename the switch to say "Enable client-side filtering", when turned on it should hide and not execute onSearchTextChanged and the below event.

  • Add a new onFilterUpdate which detects the changes made in the filters and triggers this action. This will only run when "Enable client-side filtering" is off.

dilippitchika avatar Mar 31 '22 09:03 dilippitchika

@somangshu @Tooluloope please review and move this to product backlog if clear

dilippitchika avatar Mar 31 '22 09:03 dilippitchika

@dilippitchika instead of a new property, can we just rename "Enable client side search" to "Enable client-side filtering" and use it for both search and filter because I don't see much of a use case to have search on and filter off.

Nikhil-Nandagopal avatar Mar 31 '22 12:03 Nikhil-Nandagopal

Stats

Stat Values
Reach 200
Effort (months) 0.5

dilippitchika avatar Apr 07 '22 05:04 dilippitchika

Will be handled after #9135 release

somangshu avatar Jun 28 '22 06:06 somangshu

This is a deal breaker for us, unfortunately. Any ideas when it might come around?

acron0 avatar Sep 26 '22 13:09 acron0

Hey @acron0, The dependency on this have been cleared, but we still havent prioritized this.

While I talk about this internally, can you explain your use case, Maybe we can suggest some workaround.

cc @dilippitchika

somangshu avatar Sep 26 '22 14:09 somangshu

[Internal] PRD -https://www.notion.so/appsmith/Supporting-server-side-filtering-445d8f060bf14c5b98e62dcbcd835162

dilippitchika avatar Dec 05 '22 09:12 dilippitchika

  1. TL;DR The design task was to accommodate for:
  • Switching On Server-Side Filtering property
  • Allowing a Column to be filterable or not.
  • Filterable Property reflected in Filter Dialog.
  • Filter Modes in Default Filters property.
  • Setting the Filter Data Format returned by the Table.filters
  • Allowing/Disallowing Column Filter Operators
  • Filter modes reflected in Table Filters (Desktop and Mobile)
  1. Screens Design

  2. Prototype

andrewdietekoki avatar Dec 22 '22 06:12 andrewdietekoki

Hi, is there any progress about the issue? I would like to use it too. I have a lot of fields to filter and I really like this popup. image

m1ker1n avatar Jul 11 '23 12:07 m1ker1n