1

i have one table, in that i have 2 columns one is files & and another permissions.

for all table rows i have refresh buttons.

What i need is when i click the refresh button it should only refresh the columns of the same row,where the refresh button is.

but now it is refreshing the particular row and particular column, but when i change the values in database and click refresh, the changed value is not getting updated...

here is my code:

Jquery Code

<script type="text/javascript">
    $(document).ready(function(){
        $("#buton").click(function(){
            $(this).parent().siblings(".b1").load(".b1");
            $(this).parent().siblings(".b2").load(".b2");
        });
    });      
</script>

jsp code:

<table border="1">
    <tr>
        <td class = "b1"><s:property value="%{#u.files}" /></td>
        <td class = "b2"><s:property value="%{#u.perm}" /></td>
        <td><a href=""><img src="images/refresh.png" title="Refresh" id="buton"></a></td>
    </tr>
</table>                
1
  • I must be missing something, bu you have no button here. How is your click handler supposed to be attached to anything ? Commented Sep 24, 2013 at 13:31

1 Answer 1

2

The $(this) in your button click function is the <img> element (which isn't closed by the way). The parent, which you call by $(this).parent() of that element is the <a> element, not the <td>. So you're searching for siblings of that <a> element instead of the <td> element.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.