0
我正在使用ajax調用我的web服務&在表數據中顯示Json值。現在客戶想要在每一行中編輯數據,從而點擊複選框。其中包括複選框和可編輯
一旦單擊複選框,該行應該是可編輯的。請幫助我在下面的代碼中包括複選框的位置。
$.ajax({
type: "GET", //GET or POST or PUT or DELETE verb
url: "http://localhost:8080/karthi/", // Location of the service
success: function (json) {//On Successfull service call
var txtStr = '<table class="datatable"><thead><tr> <th>id</th> <th>firstName</th> <th>lastName</th> <th>licenseId</th> <th>telephone</th> <th>email</th> </tr></thead><tbody>';
for(var i = 0; i < json.length; i++) {
txtStr += '<tr class="gradeA"> <td><a class="edit_row" href="#tab2" onclick="showDetails(\''+json[i].id+'\');">'+json[i].id+'</a></td> <td>'+json[i].firstName+'</td> <td>'+json[i].lastName+'</td> <td>'+json[i].licenseId+'</td> <td>'+json[i].telephone+'</td> <td>'+json[i].email+'</td> </tr>';
感謝您的回覆。我在thead裏添加了標題,但是我需要每行中的複選框。因此,用戶可以單擊複選框並使該行可編輯 – Karthick88it 2013-03-17 15:52:45
@ Karthick88it具有單選按鈕:'code''code'在showDetails()中有這個代碼。看起來你的代碼在這個函數中創建行 – 2013-03-17 16:45:11