Closed theamit-009 closed 3 years ago
I didn't have a lot of success altering assumed spans like this or in the doc example. But just returning plain HTML or text strings works fine.
yes, this is true, formatting cell and headers not working. Also If if want to make a clickable button in each row how can we achieve this? for example, I want to different page on each row by clicking on link.
Documentation updated https://table-sortable.now.sh/story-latest.html#formatCell https://table-sortable.now.sh/story-latest.html#formatHeader
You have to return newly created html from the functions.
var table = $('#table-sortable').tableSortable({ ... formatCell: function(row, key) { if (key === 'formCode') { return $('span').addClass('bold').text(row[key]); } if (key === 'fullName') { return $('span').addClass('uppercase').text(row[key]); } // Finally return cell for rest of columns; return row[key]; }, ... });
It only Updates the last row. and add spans consecutively.