0

I have a table that is dynamically generated, i want to find the sum column that exists at the end of the SUM row. How can I found that column ?

here's my jquery so far:

keyup: function (e) {

            // get the level
            var level = $(this).closest('tr').attr('id');

            // this = all columns in the row
            var inputValue = $(this).find('input').val();

            // get account nr from first column
            var account = $(this).closest('tr').children().eq(0).text();

            // get all elements with the same level id
            var elements = $('tr[id=' + level + ']'); //.find('*').filter(function () {    

here is my table

<table id="table">
    <!-- 
        row is dyanmically looped and tr id can be whatever in that format 
        and has many of the same id
    -->
    <tr id="1-2-2">
          <td>test</td>
          <td><%= x.Description %></td>
          <td>test</td>
          <td>test</td>
          <td><label name="account-<%= rad.Konto %>"></label></td>
        </tr>

When the Description is SUM then I want to get the label from the last column on the same row and update it with new value that is entered in the keydown function.

4

0 回答 0