sorting/filtering of the table - can't have any idea about the columns you hidden or shown with just client side script. So use visible attribute management by ajax in order to synch-up the server side and client side state.
I can understand serverside dont know what i did. but why the sorting just reset the column header, not the table content. And there is no problem if it reset all (header and content).