[jQuery] Re: Refactoring problem with jquery-selectors

2008-12-29 Thread Vincent Robert
If you just want to use your function without changing the signature, you have to pass along the current this when calling your function. This is done using the call function JavaScript provides for functions. function addClickHandler(tableId, functionName, myUrl) { jQuery('#' + tableId

[jQuery] Re: Refactoring problem with jquery-selectors

2008-12-28 Thread Michael Geary
The problem is the first line in your clickOnTableRowResultSet() function: var row = jQuery(this); When you were using that function directly as a click handler, 'this' was set to the element being clicked. But now you are calling the function through an ordinary function call, so

[jQuery] Re: Refactoring problem with jquery-selectors

2008-12-28 Thread j0llyr0g3r
Hui, fast reply.:-) I did as you proposed and it works fine now. Special thanks for the explanation! On 28 Dez., 22:26, Michael Geary m...@mg.to wrote: The problem is the first line in your clickOnTableRowResultSet() function:         var row = jQuery(this); When you were using that