- Fixed bug #250: sorting truncated tables.

- Tables can now be sorted on the first column too (object name).

SVN:trunk[791]
This commit is contained in:
Denis Flaven
2010-09-07 15:43:26 +00:00
parent 88643dab96
commit 142a64dfc9
4 changed files with 9 additions and 12 deletions

View File

@@ -216,7 +216,7 @@ class iTopWebPage extends NiceWebPage
// End of Tabs handling
$("table.listResults").tableHover(); // hover tables
$(".listResults").tablesorter( { headers: { 0:{sorter: false }}, widgets: ['myZebra', 'truncatedList']} ); // sortable and zebra tables
$(".listResults").tablesorter( { widgets: ['myZebra', 'truncatedList']} ); // sortable and zebra tables
$(".date-pick").datepicker({
showOn: 'button',
buttonImage: '../images/calendar.png',

View File

@@ -179,7 +179,7 @@ class UILinksWizard
function(data)
{
$('#SearchResultsToAdd').html(data);
$('#SearchResultsToAdd .listResults').tablesorter( { headers: { 0:{sorter: false }}, widgets: ['zebra']} ); // sortable and zebra tables
$('#SearchResultsToAdd .listResults').tablesorter( { widgets: ['myZebra', 'truncatedList']} ); // sortable and zebra tables
},
'html'
@@ -233,7 +233,7 @@ class UILinksWizard
}
$('.listResults tbody').append(data);
$('.listResults').trigger('update');
$('.listResults').tablesorter( { headers: { 0:{sorter: false }}, widgets: ['zebra']} ); // sortable and zebra tables
$('.listResults').tablesorter( { widgets: ['myZebra', 'truncatedList']} ); // sortable and zebra tables
},
'html'
);

View File

@@ -97,7 +97,7 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix)
function(data)
{
$(sSearchAreaId).html(data);
$(sSearchAreaId+' .listResults').tablesorter( { headers: { 0:{sorter: false }}, widgets: ['zebra']} ); // sortable and zebra tables
$(sSearchAreaId+' .listResults').tablesorter( { widgets: ['myZebra', 'truncatedList']} ); // sortable and zebra tables
},
'html'
@@ -151,7 +151,7 @@ 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( { headers: { 0:{sorter: false }}, widgets: ['zebra']} ); // sortable and zebra tables
$('#linkedset_'+me.id+' .listResults').tablesorter( { widgets: ['myZebra', 'truncatedList']} ); // sortable and zebra tables
$('#linkedset_'+me.id+' :input').each( function() { $(this).trigger('validate', ''); }); // Validate newly added form fields...
}
},

View File

@@ -13,7 +13,7 @@ function ReloadTruncatedList(divId, sSerializedFilter, sExtraParams)
$('#'+divId).append(data);
$('#'+divId).removeClass('loading');
$('#'+divId+' .listResults').tableHover(); // hover tables
$('#'+divId+' .listResults').tablesorter( { headers: { 0:{sorter: false }}, widgets: ['zebra']} ); // sortable and zebra tables
$('#'+divId+' .listResults').tablesorter( { widgets: ['zebra', 'truncatedList']} ); // sortable and zebra tables
//$('#'+divId).unblockUI();
}
);
@@ -24,17 +24,14 @@ function ReloadTruncatedList(divId, sSerializedFilter, sExtraParams)
function TruncateList(divId, iLimit, sNewLabel, sLinkLabel)
{
var iCount = 0;
$('#'+divId+' table.listResults tr').each( function(){
if (iCount > iLimit)
{
$('#'+divId+' table.listResults tr:gt('+iLimit+')').each( function(){
$(this).remove();
}
iCount++;
});
$('#lbl_'+divId).html(sNewLabel);
$('#'+divId+' table.listResults tr:last td').addClass('truncated');
$('#'+divId+' table.listResults').addClass('truncated');
$('#trc_'+divId).html(sLinkLabel);
$('#'+divId+' .listResults').trigger("update"); // Reset the cache
}
/**
* Reload any block -- used for periodic auto-reload
@@ -50,7 +47,7 @@ function ReloadBlock(divId, sStyle, sSerializedFilter, sExtraParams)
$('#'+divId).append(data);
$('#'+divId).removeClass('loading');
$('#'+divId+' .listResults').tableHover(); // hover tables
$('#'+divId+' .listResults').tablesorter( { headers: { 0:{sorter: false }}, widgets: ['zebra']} ); // sortable and zebra tables
$('#'+divId+' .listResults').tablesorter( { widgets: ['myZebra', 'truncatedList']} ); // sortable and zebra tables
//$('#'+divId).unblockUI();
}
);