>$('#flexClients').dblclick(function (e) { > var id = $(e.target).attr('id')'; > // id should contain the row id >}); >Here is my current Edit code
function edit(com, grid) { $('.trSelected', grid).each(function () { var id = $(this).attr('id'); id = id.substring(id.lastIndexOf('row') + 3); currentId = id; $('#fntype').val('Edit'); var ClientName; ClientName = $('.trSelected td:eq(2)').text(); var url = '/Client/Edit/' + id; $.get(url, function (html) { $($dlg).html(html); }); RunModalDialog("Edit Client: " + ClientName); }); }and my bindDblClick function does
function bindDblClick() { $('#flexClients tr').dblclick(function () { edit('Edit', $('#flexClients')); }); }How should I re-write these two using your idea above? The Edit function refers to trSelected in order to take the selected row ClientName column's value.