[QUESTION] How to set permanent sort on table?
See original GitHub issueHi. I’m using useTable with initialSorter without syncWithLocation. But when I change page, the initial sort is missing. I see that there are permanentFilter.
In my case, I have a table of products. Each products have index field as the order to display in store frontpage, and seller can reorder their index.
const { tableProps, tableQueryResult, searchFormProps, filters } = useTable<IProduct>({
initialSorter: [{
field: 'index',
order: 'asc',
}],
metaData: {
fields: ['name', 'description''],
},
});
When I open the page, it display the first page correctly by sending sort to graphql query.
But when I change to next page, the sort field is empty.
Is there any way to set the table with permanent sorter?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to sort a MYSQL table in a permanent way?
You can do this with ALTER TABLE. f.e.. ALTER TABLE tablename ORDER BY columnname ASC;. but be aware that the table does not...
Read more >Sort data in a range or table - Microsoft Support
Select the range that you just entered. Using the preceding example, select cells A1:A3. Go to File > Options > Advanced > General...
Read more >Can you keep a sort on a column for a table?
It's a bit hacky, but you can sort the table how you want in view-mode, copy the rows, then edit the page and...
Read more >Permanent Sort Criteria - Ask TOM - Oracle
Permanent Sort Criteria We can use 'ORDER BY' clause for sorting data when running a SELECT query.But what if I want a permanent...
Read more >Can a default sort order be set on a table? - ServiceNow
Solved: I want to add a new module to the navigator and wanted to know if I can create a sorted view of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks a lot!
Currently I’m patching it by adding sort field to metadata and handle it on data provider.
Hey @niwasmala , We’ve released
@pankod/refine@2.6.0
withpermanentSorter
support! Could you approve this fix?