更新时间:2023-12-04 13:44:34
您可以从这里开始,
将编辑"链接更改为具有类编辑的范围.
Change the Edit link to a span with class edit.
$('span.edit').on('click', function() {
$("#dialog-form").dialog({
autoOpen : false,
height : 300,
width : 350,
modal : true,
buttons : {
"Edit an account" : function() {
name = $(this).closest('tr').find('td.custom-name').text().split(' ', 2);
email = $(this).closest('tr').find('td:nth-child(2)').text();
pass = $(this).closest('tr').find('td:nth-child(3)').text();
var fname = name[0], lname = name[1];
$("#first-name option:contains('" + name[0] + "')").attr('selected', 'selected');
$("#last-name option:contains('" + name[1] + "')").attr('selected', 'selected');
$("#email").text(email);
$("#password").text(pass);
},
Cancel : function() {
$(this).dialog("close");
}
},
close : function() {
allFields.val("").removeClass("ui-state-error");
}
});
return false;
});