* Any of these conditions can be waived if you get permission from the copyright holder.
*/
+var debug=false;
+
(function() {
fdTableSort = {
regExp_Currency: /^[£$€¥¤]/,
fdTableSort.init(false);
},
init: function(tableId) {
+ if (debug) plc_message ('entering tablesort.init');
if (!document.getElementsByTagName || !document.createElement || !document.getElementById) return;
var tables = tableId && document.getElementById(tableId) ? [document.getElementById(tableId)] : document.getElementsByTagName("table");
columnNumSortObj[i]["thNode"] = workArr[c][i];
columnNumSortObj["active"] = true;
};
-
- thtext = fdTableSort.getInnerText(workArr[c][i], true);
+ th_elt = workArr[c][i];
+ thtext = fdTableSort.getInnerText(th_elt, true);
for(var cn = workArr[c][i].childNodes.length; cn--;) {
// Skip image nodes and links created by the filter script.
aclone = a.cloneNode(true);
//aclone.appendChild(document.createTextNode(thtext));
aclone.innerHTML = thtext;
- aclone.title = "Sort on \u201c" + thtext.replace('<br />', '') + "\u201d";
+ //if the <th> has title set, use this as an alternate text for the 'sort on ...'
+ if (th_elt.title) {
+ aclone.title = th_elt.title;
+ } else {
+ aclone.title = "Sort on \u201c" + (th_elt.title ? th_elt.title : thtext.replace('<br />', '')) + "\u201d";
+ }
aclone.onclick = aclone.onkeydown = workArr[c][i].onclick = fdTableSort.initWrapper;
workArr[c][i].appendChild(aclone);
if(showArrow) workArr[c][i].appendChild(span.cloneNode(false));
};
fdTableSort.thNode = aclone = a = span = columnNumSortObj = thNode = tbl = allRowArr = rowArr = null;
+ if (debug) plc_message ('exiting tablesort.init');
},
initWrapper: function(e) {
e = e || window.event;
fdTableSort.thNode = null;
},
redraw: function(tableid, identical) {
+ if (debug) plc_message ('entering tablesort.redraw');
if(!tableid || !(tableid in fdTableSort.tableCache)) { return; };
var dataObj = fdTableSort.tableCache[tableid];
var data = dataObj.data;
};
};
tr = tds = hook = null;
+ if (debug) plc_message ('exiting tablesort.redraw');
},
getInnerText: function(el, allowBrTags) {
if (typeof el == "string" || typeof el == "undefined") return el;