mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
- 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:
@@ -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',
|
||||
|
||||
@@ -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'
|
||||
);
|
||||
|
||||
@@ -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...
|
||||
}
|
||||
},
|
||||
|
||||
11
js/utils.js
11
js/utils.js
@@ -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();
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user