vitmalina / w2ui

UI widgets for modern apps. Data table, forms, toolbars, sidebar, tabs, tooltips, popups. All under 120kb (gzipped).
http://w2ui.com
MIT License
2.63k stars 735 forks source link

w2grid: when property reorderColumns is true, sorting columns doesn't work as expected #2505

Open marcboon opened 4 months ago

marcboon commented 4 months ago

With reorderColums: true, and sortable: true in one or more columns, the sorting doesn't work. At least not with an external data source (specified in the url property). Whenever I click on the column header, two successive request are made in quick succession, One with sort direction: asc, and one with sort direction: desc, for the same column. The first request is then immediately cancelled, it seems, so the result from the server is always sorted desc

With reorderColums: false (or not specified), the sorting works normally, with just one request sent to the server, with direction alternating between 'asc' and 'desc' after each click on the column header.