#app with a table with 50k records server side pagination and filters?
1 messages · Page 1 of 1 (latest)
Hey There,
We've registered your query, and our team will get back to you soon.
Regards,
Pranav
Hello! For this you will need to implement custom filtering for your data.
Please refer to our docs
here
for more information about fetching and filtering data from SQL datasources. You
won't be able to use the tables built-in filters for this use case. Instead, you
will need to create external controls using
[Inputs](https://docs.appsmith.com/reference/widgets/input
[https://docs.appsmith.com/reference/widgets/input]) and [Select
widgets](https://docs.appsmith.com/reference/widgets/select
[https://docs.appsmith.com/reference/widgets/select]). Then, you can build your
query dynamically when filters are selected.
yea i know what
but when i set own filters and server side pagination, i only can search in the paginated page, not further pages
Please take a look at our docs for setting up server-side
search
for more information.
Thank you for your ongoing support and patience. We aim to provide you with
helpful assistance and hope we have addressed your question adequately.
Please take a moment to share your experience with our support team.
https://survey.frontapp.com/v2/09a400bf433bc9676d67/8e55b8141cbbd7ef7fa1314a11ad42ad
[https://survey.frontapp.com/v2/09a400bf433bc9676d67/8e55b8141cbbd7ef7fa1314a11ad42ad]
but when i set own filters and server side pagination, i only can search in the paginated page, not further pages
I don't fully understand the problem. Could you provide a loom.com recording or
elaborate on why you're unable to implement server-side search?
I did but when I search by filter something that is on page 2 i cant see it unless im in page 2
You know what i mean
I'm afraid not. I gave you guidance to implement external filtering for the
table, as well as server-side search. It was also pointed out that you cannot
make proper use of the built-in table filters when server-side pagination is
enabled, which is why you need external filtering. Please provide a loom.com
recording demonstrating your issue.
i will do loom
if you see cedula = 8-880-572 is on page #2 but when im in page #1 the search works, but when im in page #2 it doesnt find the 8-880-572
SELECT
*
FROM
public.tbl_clientes WHERE cedula LIKE '%{{cedula.value}}%'
LIMIT
{{Table1.pageSize}}
OFFSET
{{Table1.pageOffset}}
this is the query
hey, if you expect to get less records then a page has, you can reset the page of the table to 1, using resetWidget("tablename"). That's bc the way postgresql paginates: if your query returns 2 records, and you ask an offset of 10, it will not return the records
I don't know if the recent setters include table.setPageNumber
that would also allow you to set the page to 1
I'm writing from memory so someone may correct me if I'm wrong
how to do that?
I think you have to learn jsobjects... bind the search box to a js function that resets the table to page 1, and then runs the sql query, similar to the docs but instead of binding the search box to the query directly, instead you run the js function to first reset the table and after run the sql query (https://docs.appsmith.com/build-apps/how-to-guides/Setup-Server-side-Searching-on-Table). By the way I'm a user so just giving my thoughts here
maybe there's a better way
woh looks complicated
Hello @hexed verge!
@ember maple is correct here, and their analysis of the issue is
accurate. You should create a JS function that resets the table widget with
resetWidget()
and then runs the relevant query. You can then bind that function to your tables
[onSearchTextChanged
event](https://docs.appsmith.com/reference/widgets/table#onsearchtextchanged
[https://docs.appsmith.com/reference/widgets/table#onsearchtextchanged]).
For more information about JS Objects, please refer to our docs
[here](https://docs.appsmith.com/core-concepts/writing-code/javascript-editor-beta
[https://docs.appsmith.com/core-concepts/writing-code/javascript-editor-beta]).
Thank you for your ongoing support and patience. We aim to provide you with
helpful assistance and hope we have addressed your question adequately.
Please take a moment to share your experience with our support team.
https://survey.frontapp.com/v2/09a400bf433bc9676d67/180f38dc7c7bd525e7c626ccc741a849
[https://survey.frontapp.com/v2/09a400bf433bc9676d67/180f38dc7c7bd525e7c626ccc741a849]
The JavaScript Editor in Appsmith enables you to create JS Objects with a page-level scope. A JS Object is an encapsulation of variables and functions associated with it. It is a template similar to a Java class that contains the variables and the methods used to perform actions.
i cant bind it to onsearchtext changed, as i will have 5 custom filers, diff textinput, date range, select box
also what will happen if user select more than one filter?