12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- // Licensed Materials - Property of IBM
- //
- // IBM Cognos Products: pps
- //
- // (C) Copyright IBM Corp. 2005, 2017
- //
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- var sortIcons = new Array();
- sortIcons[0] = topparent.getGlobal("imgPath") + "list_sort_no.gif";
- sortIcons[1] = topparent.getGlobal("imgPath") + "list_sort_descending.gif";
- sortIcons[2] = topparent.getGlobal("imgPath") + "list_sort_ascending.gif";
- function showSortState (obj, rowOrCol)
- {
- if (!obj || !obj.getAttribute("nodeId"))
- return;
-
- if (!obj.sort)
- showSortIcon (obj, rowOrCol, obj.getAttribute("nodeId"));
- }
- function showSortIcon (obj, rowOrCol, nodeId)
- {
- if (!obj || obj.sort)
- return;
- if (obj.hasChildNodes())
- {
- var children = obj.childNodes;
- for (var i = 0; i < children.length; i++)
- {
- if (children[i].tagName == "A" && children[i].hasChildNodes() && children[i].childNodes[0].tagName == "IMG" && children[i].childNodes[0].className.indexOf("hiddenSortIcon") >= 0)
- children[i].childNodes[0].className = "sortIcon";
- if (children[i].hasChildNodes())
- showSortIcon (children[i], rowOrCol, nodeId);
- }
- }
- }
- function hideSortIcon(obj)
- {
- if (!obj || obj.sort)
- return;
- if (obj.hasChildNodes())
- {
- var children = obj.childNodes;
- for (var i = 0; i < children.length; i++)
- {
- if (children[i].tagName == "A" && children[i].hasChildNodes() && children[i].childNodes[0].tagName == "IMG" && children[i].childNodes[0].className.indexOf("sortIcon") >= 0)
- children[i].childNodes[0].className = "hiddenSortIcon";
- if (children[i].hasChildNodes())
- hideSortIcon (children[i]);
- }
- }
- }
- //have to add parameters for border, etc...
- //this function can be used for any rollover functions on images
- function changeIcon (obj, src, alt)
- {
- obj.src = src;
- if (alt)
- {
- obj.alt = alt;
- what(alt);
- }
- }
- function showSortMenu(event, rowOrCol, nodeId, id) {
- var arrayContextMenu = topparent.getGlobal("main_ContextMenu");
- var nodePath = "";
- if (rowOrCol == "r")
- {
- nodePath = topparent.getToolbarFrame().getNestedPath(document.getElementById(id), "row", true);
- }
- else
- {
- nodePath = topparent.getToolbarFrame().getNestedPath(document.getElementById(id), "col", true);
- }
- ContextMenu.display(event, [
- new ContextItem('', arrayContextMenu["sort_desc"]._label, function() {doit("S1:" + rowOrCol + nodeId + "p" + nodePath)}),
- new ContextItem('', arrayContextMenu["sort_asce"]._label, function() {doit("S2:" + rowOrCol + nodeId + "p" + nodePath)}),
- new ContextItem('', arrayContextMenu["sort_none"]._label, function() {doit("S0:" + rowOrCol + nodeId + "p" + nodePath)})
- ], true);
- }
|