mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
-Fix for sorting the tables and taking into account the fact that the first column is not sort-able when it contains checkboxes.
-Also adds icons (up/down arrows to indicate the current sort order). - Last but not least fixes a number of problems when adding/removing linked objects the lists were not sorting or hilighting properly. SVN:trunk[828]
This commit is contained in:
@@ -270,7 +270,23 @@ class DisplayBlock
|
||||
$("#'.$sId.'").empty();
|
||||
$("#'.$sId.'").append(data);
|
||||
$("#'.$sId.'").removeClass("loading");
|
||||
$("#'.$sId.' .listResults").tablesorter( { headers: { 0:{sorter: false }}, widgets: [\'zebra\']} ); // sortable and zebra tables
|
||||
// Check each "listResults" table for a checkbox in the first column and make the first column sortable only if it does not contain a checkbox in the header
|
||||
$("#'.$sId.'".listResults").each( function()
|
||||
{
|
||||
var table = $(this);
|
||||
var id = $(this).parent();
|
||||
var checkbox = (table.find(\'th:first :checkbox\').length > 0);
|
||||
if (checkbox)
|
||||
{
|
||||
// There is a checkbox in the first column, do not make it sortable
|
||||
table.tablesorter( { headers: { 0: {sorter: false}}, widgets: [\'myZebra\', \'truncatedList\']} ); // sortable and zebra tables
|
||||
}
|
||||
else
|
||||
{
|
||||
// There is NO checkbox in the first column, all columns are considered sortable
|
||||
table.tablesorter( { widgets: [\'myZebra\', \'truncatedList\']} ); // sortable and zebra tables
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
</script>';
|
||||
|
||||
Reference in New Issue
Block a user