views:

470

answers:

1

i m using jQuery tablsorter plugin, it's working perfect,but now problem is ... i want to enable sorting only on 1'st and 3'rd column, and i also want to show different color of alternate row. i used widgets:[zebra], but using widget zebra, it enables sorting on all column as well as images(asc.gif,desc.gif,bg.gif) is also appearing on all headers whereas i only want these on only first and 3rd column

how to use zebra widget with specific column sorting not the whole columns sorting

here is my code

<script type="text/javascript">
$(document).ready(function()
{
$("#managerTable").tablesorter({widgets: ['zebra']},
{sortList:[[0,0]],headers:{2:{sorter:false},4:{sorter:false}}
});     
});
</script>
+1  A: 

Well, I'm just an apprentice of all this, but the way of going through this was to do it this way. This work perfectly for me, so I would say that may be the problem is that you aren't giving the parameters to tablesorter method in a proper way, I mean, the widgets tag should go with sortList and headers in the parameters structure. This is just a thought, as my knowledge is limited, but I hope this helps.

$("#table").tablesorter({
                headers: { 0: { sorter: false }, 
                           2: { sorter: false }, 
                sortList: [[0, 0], [2, 0]],
                widgets: ['zebra']
            })

Greetings

vikitor
there is little bit parse error in above code, perfect code is below, `$("#managerTable").tablesorter({headers:{2:{sorter:false},4:sorter:false},sortList:[0,0]},widgets:['zebra']});`Thanks for the suggestion
diEcho