JQuery/Javascript Reordering rows

前端 未结 8 1362
时光说笑
时光说笑 2021-02-06 06:50

I have a aspx page that looks something like this:


  Some label
  Some complex control
         


        
8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-06 07:10

    If the last sorting done by the user is stored as a list containing the row id, you could do this:

    loop through list from db {
        $("#"+rowId).appendTo("#tableId")
    }
    

    This way, the rows will be taken out of their current location and replaced inside the table in the order they are stored in the database.

提交回复
热议问题