bSortable and ThemeRoller

bSortable and ThemeRoller

mathiemathie Posts: 36Questions: 0Answers: 0
edited September 2009 in Bug reports
When I disable the bSortable for a column and use Smoothness (JQueryUI ThemeRoller), the header styling just did not apply to the column header. From Firebug, the class "ui-state-default" only is applied to the ones that are sortable. Is it a bug or am I missing something? Thanks

Replies

  • mathiemathie Posts: 36Questions: 0Answers: 0
    From line 3374, it seems the CSS class is only added if both sortable and visible.
    [code]if ( oSettings.aoColumns[i].bSortable && oSettings.aoColumns[i].bVisible )[/code]

    I think it should add the default header class (ui-state-default) even if it's not sortable to the non-sortable does not look odd with the other columns. We have several columns that do not make sense to enable sorting.
  • mathiemathie Posts: 36Questions: 0Answers: 0
    This is my quick fix. Better solution would define "oClasses.sNonSortable" instead of using the direct string

    [code]
    /* not-sortable but visible */
    if (!oSettings.aoColumns[i].bSortable && oSettings.aoColumns[i].bVisible)
    {
    $(oSettings.aoColumns[i].nTh).addClass('ui-state-default');
    } // fi

    if ( oSettings.aoColumns[i].bSortable && oSettings.aoColumns[i].bVisible )
    {
    sClass = oClasses.sSortable;
    .....
    [/code]
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Hi mathie,

    Thanks for following up on this. An option for 'oClasses.sNonSortable' sounds like quite a good idea to me :-). Didn't really occur to me that non-sortable columns would need a class as well (since without theme roller you would just target the 'TH' with a selector).

    Allan
This discussion has been closed.