0

I have a webgrid in my my page with some data. Beside every row, there is as action link, edit. When the user clicks the edit action link, the selected row should be displayed in popup with Save and Cancel buttons on it.

zachjs
  • 1,738
  • 1
  • 11
  • 22
being fab
  • 657
  • 3
  • 12
  • 22

3 Answers3

1

If your data is rendering in table then you can go through this way

<script>

    $(document).ready(function () {
        $('a[id$ = yourid]').click(function () {
            var row = $(this).closest('tr');
            var var1 = row.find('#idOfControl').val();
            alert(var1);
        });
    });

</script>
Ankush Jain
  • 1,532
  • 1
  • 15
  • 24
0

On click on any row, open popup window and navigate to a page which would give you all the details about the selected row content, by passing the selected row id as the querystring argument..

techBeginner
  • 3,792
  • 11
  • 43
  • 59
0

Try this:

$("#tblID tbody").on("click","a", function(){    
        var $row = $(this).closest("tr");
        alert($row.find("td").eq(0));//.eq() - index of td.    
    });
Sumit Singh
  • 15,743
  • 6
  • 59
  • 89
nix
  • 3,262
  • 2
  • 21
  • 36