views:

345

answers:

1

Hi,

I have the following Javascript, it's not working the way I want it to. I want to disable sorting with some header. The problem is when I put the first function to disable the some header, it makes other header one-way sortable only, though they should be two sortable.

  $(document).ready(function() {

$("#TimeSheet").tablesorter({
    // pass the headers argument and assing a object 
    headers: {
        // assign the secound column (we start counting zero) 
        1: {
            // disable it by setting the property sorter to false 
            sorter: false
        },
        // assign the third column (we start counting zero) 
        2: {
            // disable it by setting the property sorter to false 
            sorter: false
        }
    }
}); 


$("#TimeSheet").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'] })
                    .tablesorterFilter({ filterContainer: $("#filterBox"),
                        filterClearContainer: $("#filterClear"),
                        filterColumns: [0, 1],
                        filterCaseSensitive: false
                    });                  
});

It's not good to call tablesorter two time just disable some headers, also the other header can be sorted only one way not two ways any more. I think it's because of the first function that disables some header. I'm trying to disable some header in the second function but I can't have it worked yet. Any suggestion? Thank you.

A: 

FYI:

I just figured it out, please take a look at the following :

    $("#TimeSheet").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'], headers: {8:{sorter: false }} })
                    .tablesorterFilter({ filterContainer: $("#filterBox"),
                        filterClearContainer: $("#filterClear"),
                        filterColumns: [0, 1],
                        filterCaseSensitive: false
                    });
});

narazana