Лучший Ответ Kess , 18 June 2014 - 11:24
Hello,
I've tried to implement this - http://tablesorter.c...le-parsers.html and it works fine.
So here is how my days-of-week element look like:
Then I changed tablesorter initialization script in this file by adding parser for days:
media/zoo/applications/jbuniversal/templates/catalog/renderer/item_columns/database.php
So it looks like this now:
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery.tablesorter.addParser({
id: 'days',
is: function(s) {
return false;
},
format: function(s) {
return s.toLowerCase().replace(/monday/,1).replace(/tuesday/,2).replace(/wednesday/,3).replace(/thursday/,4).replace(/friday/,5).replace(/saturday/,6).replace(/sunday/,7);
},
type: 'numeric'
});
jQuery(function() {
jQuery(".jsTableSorter").tablesorter({
headers: {
6: {
sorter:'days'
}
}
});
});
});
</script>
Here is the result:
Перейти к сообщению


Тема закрыта







