function enableUI() {
        var i,
            el,
            ithSorter = function ithSorter(i) {
                var col = cols[i];

                return function () {
                    var desc = col.defaultDescSort;

                    if (currentSort.index === i) {
                        desc = !currentSort.desc;
                    }
                    sortByIndex(i, desc);
                    removeSortIndicators();
                    currentSort.index = i;
                    currentSort.desc = desc;
                    addSortIndicators();
                };
            };
        for (i =0 ; i < cols.length; i += 1) {
            if (cols[i].sortable) {
                // add the click event handler on the th so users
                // dont have to click on those tiny arrows
                el = getNthColumn(i).querySelector('.sorter').parentElement;
                if (el.addEventListener) {
                    el.addEventListener('click', ithSorter(i));
                } else {
                    el.attachEvent('onclick', ithSorter(i));
                }
            }
        }
    }
// adds event listeners for all sorter widgets
adds event listeners for all sorter widgets
adds event listeners for all sorter widgets
function enableUI() {
        var i,
            el,
            ithSorter = function ithSorter(i) {
                var col = cols[i];
                return function () {
                    var desc = col.defaultDescSort;
                    if (currentSort.index === i) {
                        desc = !currentSort.desc;
                    }
                    sortByIndex(i, desc);
                    removeSortIndicators();
                    currentSort.index = i;
                    currentSort.desc = desc;
                    addSortIndicators();
                };
            };
        for (i =0 ; i < cols.length; i += 1) {
            if (cols[i].sortable) {
                el = getNthColumn(i).querySelector('.sorter').parentElement;
                if (el.addEventListener) {
                    el.addEventListener('click', ithSorter(i));
                } else {
                    el.attachEvent('onclick', ithSorter(i));
                }
            }
        }
    }
function enableUI ( ) { var i , el , ithSorter = function ithSorter ( i ) { var col = cols [ i ] ; return function ( ) { var desc = col . defaultDescSort ; if ( currentSort . index === i ) { desc = ! currentSort . desc ; } sortByIndex ( i , desc ) ; removeSortIndicators ( ) ; currentSort . index = i ; currentSort . desc = desc ; addSortIndicators ( ) ; } ; } ; for ( i = 0 ; i < cols . length ; i += 1 ) { if ( cols [ i ] . sortable ) { el = getNthColumn ( i ) . querySelector ( '.sorter' ) . parentElement ; if ( el . addEventListener ) { el . addEventListener ( 'click' , ithSorter ( i ) ) ; } else { el . attachEvent ( 'onclick' , ithSorter ( i ) ) ; } } } }
adds event listeners for all sorter widgets
adds event listeners for all sorter widgets
// add the click event handler on the th so users // dont have to click on those tiny arrows