Geeks With Blogs
Josh Tenenbaum Errant ramblings

I forgot this:

You can run this on $().ready(function() {

    SetHeaderSortLinks('aGrid', 'Get()');




In the global js include.

function SetHeaderSortLinks(parent, functionToCall) {

    //Clear existing links

    $("#" + parent + " th").unbind("onclick");


    $("#" + parent + " th").bind("click", function () {

        var sortOn = $(this)[0].sort;


        if (currentSortField == sortOn)

            currentSortAsc = !currentSortAsc;


        currentSortField = sortOn;







I'll probably add some css to change the cursor on mouseover based on the attribute (probably add an additional class in the function above)…

Posted on Wednesday, January 19, 2011 7:42 PM | Back to top

Comments on this post: Client Sorting on a GridView Part B

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Josh Tenenbaum | Powered by: