rfe #12159: Asset Manager sort preferences

This commit is contained in:
Paul Driver 2011-06-13 13:22:16 -05:00
parent 328826e3f7
commit 1ff1ffe423
5 changed files with 106 additions and 22 deletions

View file

@ -203,14 +203,6 @@ WebGUI.AssetManager.onMoreClick = function (e, a) {
menu.focus();
};
/*---------------------------------------------------------------------------
WebGUI.AssetManager.DefaultSortedBy ( )
*/
WebGUI.AssetManager.DefaultSortedBy = {
"key" : "lineage",
"dir" : YAHOO.widget.DataTable.CLASS_ASC
};
/*---------------------------------------------------------------------------
WebGUI.AssetManager.BuildQueryString ( )
*/
@ -314,7 +306,9 @@ WebGUI.AssetManager.initDataTable = function (o) {
{ key: 'childCount' }
],
metaFields: {
totalRecords: "totalAssets" // Access to value in the server response
totalRecords : 'totalAssets',
sortColumn : 'sort',
sortDirection : 'dir'
}
};
@ -329,13 +323,19 @@ WebGUI.AssetManager.initDataTable = function (o) {
initialRequest : 'recordOffset=0',
dynamicData : true,
paginator : assetPaginator,
sortedBy : WebGUI.AssetManager.DefaultSortedBy,
generateRequest : WebGUI.AssetManager.BuildQueryString
}
);
WebGUI.AssetManager.DataTable.handleDataReturnPayload = function(oRequest, oResponse, oPayload) {
oPayload.totalRecords = oResponse.meta.totalRecords;
var m = oResponse.meta;
oPayload.totalRecords = m.totalRecords;
this.set('sortedBy', {
key: m.sortColumn,
dir: m.sortDirection === 'desc' ?
YAHOO.widget.DataTable.CLASS_DESC :
YAHOO.widget.DataTable.CLASS_ASC
});
return oPayload;
};