We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vben Admin V5
When i config default sort like vxe-table sort At the first time, sorts param is empty
// Grid configuration
const gridOptions: VxeGridProps<RowType> = { checkboxConfig: { highlight: true, labelField: 'name', }, columns: [ { title: '序号', type: 'seq', width: 50 }, { align: 'left', title: 'Name', type: 'checkbox', width: 100 }, { field: 'category', sortable: true, title: 'Category' }, // change here { field: 'color', title: 'Color' }, { field: 'productName', title: 'Product Name' }, { field: 'price', title: 'Price' }, { field: 'releaseDate', formatter: 'formatDateTime', title: 'DateTime' }, ], exportConfig: {}, height: 'auto', keepSource: true, proxyConfig: { ajax: { query: async ({ page, sort, sorts }) => { console.log('🚀 come here baby ======> ~ query: ~ sort:', sort); console.log('🚀 come here baby ======> ~ query: ~ sorts:', sorts); return await getExampleTableApi({ page: page.currentPage, pageSize: page.pageSize, }); }, }, sort: true, // change here }, sortConfig: { // change here defaultSort: { field: 'category', order: 'desc', }, remote: true, }, toolbarConfig: { custom: true, export: true, // import: true, refresh: true, zoom: true, }, };
The first time call method ajax
Expect result: The default sort must have a value the first time.
System: OS: Windows 10 10.0.19045 CPU: (12) x64 Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz Memory: 602.43 MB / 15.85 GB Binaries: Node: 20.12.2 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - ~\scoop\apps\yarn\current\bin\yarn.CMD npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD pnpm: 9.13.2 - ~\AppData\Local\pnpm\pnpm.EXE bun: 1.1.18 - ~\AppData\Roaming\npm\bun.CMD Browsers: Internet Explorer: 11.0.19041.4355
No response
The text was updated successfully, but these errors were encountered:
This is a VxeTable bug. If autoLoad is set to false, the sorting parameters will be missing when the table is refreshed for the first time
VxeTable
autoLoad
Sorry, something went wrong.
版本:5.5.1,将autoLoad设置为true,也不生效
那是因为useVxeGrid重新包装时,传入VxeGrid的autoLoad永远是false,由useVxeGrid内部管理了自动刷新的逻辑。另外,VxeTable的刷新按钮默认code是reload,如果需要保持排序数据,配置toolbarConfig时refresh不要传true,传{code: 'query'},这样的话从第二次刷新开始,排序数据就会有效
{code: 'query'}
Successfully merging a pull request may close this issue.
Version
Vben Admin V5
Describe the bug?
When i config default sort like vxe-table sort
At the first time, sorts param is empty
Reproduction
// Grid configuration
The first time call method ajax
Expect result:
The default sort must have a value the first time.
System Info
Relevant log output
No response
Validations
The text was updated successfully, but these errors were encountered: