Similar to paging, I want to bind a click event to each filter area. When clicked, the field to be filtered will be obtained. Then you can get the desc or asc style of the area, and then return to the background order, return data, and display the data
Similar to paging, I want to bind a click event to each filter area. When clicked, the field to be filtered will be obtained. Then you can get the desc or asc style of the area, and then return to the background order, return data, and display the data
I happened to see this case while reading "The Definitive Guide to JavaScript" this morning. I took a photo and shared it with you
Finally just submit the return value to the server
I also made a table sorting requirement last month. I used the AngularJS plug-in ui-grid to do it, which is very convenient
1. If the amount of data is large and paging is required, pass the field names and sorting methods to be sorted to the backend;
2. The amount of data is small, no paging is needed, or front-end paging can be used, and sorting can be achieved through js.
Can be sorted directly on the front end, such as the Bootstrap Datatable plug-in.
DataTables