akottr / dragtable

re-order table columns by using drag'n'drop
http://akottr.github.io/dragtable
MIT License
203 stars 166 forks source link

function to get the current order list #49

Open mmjamal opened 9 years ago

mmjamal commented 9 years ago

Hello this plugin looks great,however is there any doco related to getting the order list,

Just need to know in the following cases. Once the dragtable is applied to a table - how can i get the current order list.?

ainglese commented 8 years ago

@mmjamal have you solved your issue? i have a similar one, i'm tring to solve looking here http://akottr.github.io/dragtable/

see

$('#localStorageTable').dragtable({ 
    persistState: function(table) { 
      if (!window.sessionStorage) return; 
      var ss = window.sessionStorage; 
      table.el.find('th').each(function(i) { 
        if(this.id != '') {table.sortOrder[this.id]=i;} 
      }); 
      ss.setItem('tableorder',JSON.stringify(table.sortOrder)); 
    }, 
    restoreState: eval('(' + window.sessionStorage.getItem('tableorder') + ')') 
}); 
UsmanJavedAttari commented 5 years ago

@ainglese it's not working for large tables.