added alphanumeric sort button to Matrix defaul view

This commit is contained in:
Yung Han Khoe 2009-04-12 21:06:12 +00:00
parent 4c7e1b4cfd
commit a2540ddbfd
5 changed files with 13 additions and 1 deletions

View file

@ -5,6 +5,7 @@
- Survey [[question variable]] now returns the shown answer text for multiple choice questions, and the recorded value for non-multiple choice questions.
- fixed #10142: Matrix 2.0 - Search screen compare button not functional
- fixed #10141: Matrix 2.0 - Search does not check matching products
- fixed #10077: after matrix sort can't return to alphanumeric sort
7.7.3
- fixed #10094: double explanation in thread help

View file

@ -567,6 +567,8 @@ sub view {
$varStatistics = JSON->new->decode($varStatisticsEncoded);
}
else{
$varStatistics->{alphanumeric_sortButton} = "<span id='sortByName'><button type='button'>Sort by name</button></span><br />";
# Get the MatrixListing with the most views as an object using getLineage.
my ($bestViews_listing) = @{ $self->getLineage(['descendants'], {
includeOnlyClasses => ['WebGUI::Asset::MatrixListing'],
@ -629,7 +631,7 @@ sub view {
lastUpdated => $self->session->datetime->epochToHuman($lastUpdatedListing->get('lastUpdated'),"%z")
});
}
$var->{lastUpdated_sortButton} = "<span id='sortByUpdated'><button type='button'>Sort by updated</button></span><br />";
$varStatistics->{lastUpdated_sortButton} = "<span id='sortByUpdated'><button type='button'>Sort by updated</button></span><br />";
# For each category, get the MatrixListings with the best ratings.

View file

@ -77,6 +77,15 @@ YAHOO.util.Event.addListener(window, "load", function() {
},this,true);
}
if(document.getElementById("sortByName")){
var btnSortByName = new YAHOO.widget.Button("sortByName");
btnSortByName.on("click", function(e) {
this.myDataTable.sortColumn(this.myDataTable.getColumn(1));
var request = YAHOO.util.Connect.asyncRequest('POST', matrixUrl + "?func=setSort;sort=lastUpdated");
},this,true);
}
var myCallback = function() {
this.set("sortedBy", null);
this.onDataReturnAppendRows.apply(this,arguments);