There is a table header with an empty body.
<table id="tablem" border="1" width="100"> <thead> <tr> <th style="width: 10%">PageName</th> <th style="width: 5%">Lang</th> <th style="width: 10%">ControlName</th> <th style="width: 70%">ControlValue</th> <th style="width: 5%">Edit</th> </tr> </thead> <tbody> </tbody> </table>
The body is filled with an AJAX request, where data is obtained from the base and a table is built:
function ForSearching(args, callback) { $.ajax({ url: "/source_pages/SearchForMultilang.ashx", type: "POST", dataType: "json", data: args, }).success(function(data) { var table = $("#tablem tbody"); $("#tablem tbody").empty(); callback(data); $.each(data, function (idx, elem) { table.append('<tr><td>' + elem.PageName + '</td><td>' + elem.Lang + '</td><td>' + elem.ControlName + '</td><td>' + elem.ControlValue + '</td><td><input type="button" id="btnedt" value="Edit" /></td></tr>'); }); }); }
The table is created, filled, the Edit button is created in the last column. How when clicking this button to make the cells in the row where the button is located, become <input type='text'> with the values in them from these cells, with the ability to edit and then save and display the changes?