OL Learn

Sort a detail table on a specified field planetpress

Hello there is any easy way to sort detail table on a specified filed? I have a field “Total” and need to be sort descending order.

I tried this script but is not working for me for some reason
(selector “#table tbody tr”)

var items=[];
results.each(function(index) {
field = record.tables[“detail”][index].fields[“Total”];
items.push(field);
});

items.sort();
results.each(function(index) {
this.html(items[index]);
});

Thank You for your help

This is a duplicate question that was addressed in this other topic.