开发者

jquery 'tablesorter' zebra widget do sort all column unnecessarily!

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()
{
$("#ma开发者_运维百科nagerTable").tablesorter({widgets: ['zebra']},
{sortList:[[0,0]],headers:{2:{sorter:false},4:{sorter:false}}
});     
});
</script>


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜