mleibman / SlickGrid

A lightning fast JavaScript grid/spreadsheet
http://wiki.github.com/mleibman/SlickGrid
MIT License
6.81k stars 1.99k forks source link

jQuery ui adapt #90

Open ezidio opened 13 years ago

ezidio commented 13 years ago

I need 2 modifications to jQuery-Ui support in the file slick.grid.js;

1 - Add support to jQuery-Ui order icons;

In the createColumnHeaders, replace the sort-indicator icon code to this (line 497):

if (m.sortable) {
    header.append("<span class='slick-sort-indicator ui-icon ui-icon-triangle-2-n-s' />");
}

Replace the function setSortColumn original to this (line 1028):

function setSortColumn(columnId, ascending) {
        sortColumnId = columnId;
        sortAsc = ascending;
        var columnIndex = getColumnIndex(sortColumnId);

        $headers.children().removeClass("slick-header-column-sorted");
        $headers.find(".slick-sort-indicator")
            .addClass('ui-icon-triangle-2-n-s')
            .removeClass("ui-icon-triangle-1-s ui-icon-triangle-1-n");
        if (columnIndex != null) {
            $headers.children().eq(columnIndex)
                .addClass("slick-header-column-sorted")
                .find(".slick-sort-indicator")
                    .removeClass('ui-icon-triangle-2-n-s')
                    .addClass(sortAsc ? "ui-icon-triangle-1-s" : "ui-icon-triangle-1-n");
        }
    }

2 - Replace the Css class ui-state-active to ui-state-highlight; This is referenced in the lines 1060, 1068 and 1183;

ezidio commented 13 years ago

I believe that the ui-state-highlight class is more semantic for the line selection. The JQueryUi Datepicker uses this class to mark the "today" day.