Tablesorter images in column

Tablesorter images in column

  1. I'm using the tablesorter, nice plugin. My problem is in my table the second column will have an image and text beside it. When I try to sort the table sort tries its best with the text but it will not sort it properly. I think the image is causing the problem. I'm using the function to tell tablesorter to use the add parser but I'm not having any luck. I though it could sort by using the image alt text. Any help is appreciated.

    [code]
    $(function() {
            $("#<%=manage_employees.ClientID%>").tablesorter({
                headers: {
                    1: { sorter:'myimg' },
                    3: { sorter:'formattedNumbers'}, // RV changed 11/01/12 3 to 2
                    4: { sorter:'text'}
                }
            });
        });  
    [/code]
    [code]
    $.tablesorter.addParser(
    {
        // set a unique id
        id: 'myimg',
        is: function(s)
        {
            // return false so this parser is not auto detected
            return false;
        },
        format: function(s)
        {
            // format your data for normalization
            return $(s).find('img').attr('alt');
        },
        // set type, either numeric or text
        type: 'text'
    });
    [/code]