Closed zloystrelok closed 8 years ago
hi,
currently you cannot set indices, but you can fix position of some rows by putting attribute data-disable-sorting
on them. such rows won't be sorted then
does that cover your use case?
Hello! I want to have first column with 1,2,3 no matter what sorting is applied to the table. It's not about fixing position of rows.
so you mean that before sorting the rows are not first, second thirs, but after sorting, you want to have them in that order?
i mean that i want to count rows visually, and I need first column with line nos. Want a screenshot?
yes please, I think I don't understand what you mean
aha, so you want the column to be fixed, that's unfortunately not possible, because the sorting is done on rows as the smallest entity
there is an event triggered after the sorting, so you can hook on it and change the content of the first column after sorting
Yes, exactly. I know that now there's no such functionality :) What about implementing it in new version? :)
I'm affraid that it's not possible with how the sorting works
Well', I'm done with this script:
$('#statTable').on('sorted', function () {
var userListTable = document.getElementById('statTable');
for (var i = 1; i < userListTable.rows.length; i++) {
userListTable.rows[i].cells[0].innerText = i;
}
});
yes, that's what I meant
Hello! Thank you very much for your excellent script. It's really easy to use and quite powerful.
Would you please add one tiny feature to it? I'm talking about optional first column with Line No., 1,2,3, etc. which will be constant in any sorting type.