The javascipt refresh and sort function is called through onload function i jsp page and fill the table data from database . The problem is after sortting the table column either ascedning or descedning the refresh is called every 30 seconds to fetch the data from database and during that time the sorted column doesn't retain the values .

I re- called the java script sort function after refresh and it looks like the it is soring whole table in ascending order but doesn't care the index where I clicked and descending is not wokring at all..

I need help that how I can retain the sorted value after refresh ..