[jQuery] Re: creating parameters dynamically

2009-09-24 Thread Richard D. Worth
You may want to do a new post with the word Tablesorter in the subject, especially if no on chimes in after a day or two. - Richard On Thu, Sep 24, 2009 at 8:52 PM, Richard D. Worth wrote: > I'm not sure how to make this work with Tablesorter. I should've specified, > I was just answering the qu

[jQuery] Re: creating parameters dynamically

2009-09-24 Thread Richard D. Worth
I'm not sure how to make this work with Tablesorter. I should've specified, I was just answering the question of how you create a hash from an array in JavaScript using jQuery's .each() and hash[key] = value syntax. - Richard On Thu, Sep 24, 2009 at 8:38 PM, Macsig wrote: > > Hi Richard. > thank

[jQuery] Re: creating parameters dynamically

2009-09-24 Thread Macsig
Hi Richard, actually I have just discovered there is a built-in way to make a column non sortable. Thanks for your help. Sig On Sep 24, 5:15 pm, "Richard D. Worth" wrote: > function createHeaders(ary) { >   var headers = {}; >   $(ary).each(function() { >     headers[this] = { sorter: false

[jQuery] Re: creating parameters dynamically

2009-09-24 Thread Macsig
Hi Richard. thanks for your reply unfortunately looks like I have some trouble to make the code works. If I call the second options everything works fine but with yours the headers are still sortable. $('.scrolling_table').tablesorter({ headers: h1 }); $('.scrolling_table').table

[jQuery] Re: creating parameters dynamically

2009-09-24 Thread Richard D. Worth
function createHeaders(ary) { var headers = {}; $(ary).each(function() { headers[this] = { sorter: false }; }); return headers; } var a1 = [0,1,2], a2 = [0,4,5,8]; var h1 = createHeaders(a1), h2 = createHeaders(a2); $(this).tablesorter({ headers: h1 }); $(this).tablesorter({ headers: