-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:
Denis Flaven
2010-09-12 21:06:09 +00:00
parent e3edf855eb
commit 5d97891616
9 changed files with 104 additions and 24 deletions

View File

@@ -36,8 +36,8 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix)
);
// Disable the button since all the selected items have been removed
$(my_id+'_btnRemove').attr('disabled','disabled');
// Re-run the zebra plugin to properly highlight the remaining lines
$('#linkset_'+this.id+' .listResults').trigger('update');
// Re-run the zebra plugin to properly highlight the remaining lines & and take into account the removed ones
$('#linkedset_'+this.id+' .listResults').trigger('update').trigger("applyWidgets");
}
@@ -97,7 +97,8 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix)
function(data)
{
$(sSearchAreaId).html(data);
$(sSearchAreaId+' .listResults').tablesorter( { widgets: ['myZebra', 'truncatedList']} ); // sortable and zebra tables
$(sSearchAreaId+' .listResults').tableHover();
$(sSearchAreaId+' .listResults').tablesorter( { headers: {0: {sorter: false}}, widgets: ['myZebra', 'truncatedList']} ); // sortable and zebra tables
},
'html'
@@ -151,7 +152,8 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix)
$('#'+me.id+'_empty_row').remove();
$('#linkedset_'+me.id+' .listResults tbody').append(data);
$('#linkedset_'+me.id+' .listResults').trigger('update');
$('#linkedset_'+me.id+' .listResults').tablesorter( { widgets: ['myZebra', 'truncatedList']} ); // sortable and zebra tables
$('#linkedset_'+me.id+' .listResults').tableHover();
$('#linkedset_'+me.id+' .listResults').trigger('update').trigger("applyWidgets"); // table is already sortable, just refresh it
$('#linkedset_'+me.id+' :input').each( function() { $(this).trigger('validate', ''); }); // Validate newly added form fields...
}
},

View File

@@ -13,7 +13,22 @@ function ReloadTruncatedList(divId, sSerializedFilter, sExtraParams)
$('#'+divId).append(data);
$('#'+divId).removeClass('loading');
$('#'+divId+' .listResults').tableHover(); // hover tables
$('#'+divId+' .listResults').tablesorter( { widgets: ['zebra', 'truncatedList']} ); // sortable and zebra tables
$('#'+divId+' .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, don't 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
}
});
//$('#'+divId).unblockUI();
}
);
@@ -47,7 +62,22 @@ function ReloadBlock(divId, sStyle, sSerializedFilter, sExtraParams)
$('#'+divId).append(data);
$('#'+divId).removeClass('loading');
$('#'+divId+' .listResults').tableHover(); // hover tables
$('#'+divId+' .listResults').tablesorter( { widgets: ['myZebra', 'truncatedList']} ); // sortable and zebra tables
$('#'+divId+' .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, don't 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
}
});
//$('#'+divId).unblockUI();
}
);