[jQuery] Re: Sort losing click association

2009-04-21 Thread rcb17
I don't have an answer, but I posted a very similar question a few minutes ago on this. So I am hopeful it's something basic that we both are missing.

[jQuery] Re: Sort losing click association

2009-04-21 Thread barton
Did you look at the 'livequery' plugin? On Apr 21, 8:21 am, Blaine bla...@worldweb.com wrote: Hi, I'm currently building a list when the document is ready, then performing a sort on the list if the user clicks sort Asc or sort Desc. However, when the list is sorted and redisplayed, I lose

[jQuery] Re: Sort losing click association

2009-04-21 Thread mkmanning
Your example code works fine for me. Your event is hard-coded (not the best approach btw), and you're not overwriting the inputs (so you wouldn't need .live() or the livequery plugin. Can you be more specific about what you see happening? On Apr 21, 7:21 am, Blaine bla...@worldweb.com wrote:

[jQuery] Re: Sort losing click association

2009-04-21 Thread Blaine
I did look at the 'livequery', however it still did not seem to solve my issue. As for the above code working, you must do the following steps to see my issue. 1) Load the Page 2) Click on one of the options. 3) A alert appears. 4) Click on the Radio Button 'Sort Desc' 5) Item are re-sorted 6)

[jQuery] Re: Sort losing click association

2009-04-21 Thread mkmanning
Ah, I see; I thought you meant the click on radios. Why not just use simple event delegation? Put this in your domready function: $('#list').click(function(e){ console.log( $(e.target).text() ); }); On Apr 21, 10:36 am, Blaine bla...@worldweb.com wrote: I did look at the 'livequery',

[jQuery] Re: Sort losing click association

2009-04-21 Thread Blaine
That's a great idea, however this is just a snipplet of what I'm actually doing to outline the issue. In the real application each click function does something custom. On Apr 21, 2:58 pm, mkmanning michaell...@gmail.com wrote: Ah, I see; I thought you meant the click on radios. Why not just

[jQuery] Re: Sort losing click association

2009-04-21 Thread mkmanning
I uploaded a delegation plugin I wrote a while back, before .live(). You can pass different selectors:functions to it, so it would work in your case of having a different function for link. Check it out here, it might be useful: http://plugins.jquery.com/project/simpledelegate On Apr 21, 3:25