$(".controls header").on('click', '.edit-button', this, function(event){
arrayOfSelects = arry('store the values here, or maybe somewhere else');
dialog = '';
// this is where dynamically created html would be added to dialog var
$(dialog).dialog({
title: "Editing stuff",
dialogClass: "someDialog",
modal: true,
buttons: { "Save": function(){ edit(arrayOfSelects, this); },
"Cancel": function(){ $(this).dialog("close"); }}
});
});
从上面的示例中,如何从 x 个动态创建的元素中检索选定的值?
从对话框中选择值只会提供初始值,而不是用户进行更改后的值。使用“someDialog”类似乎不是一个好主意,因为即使在关闭之前的对话框并且再次打开相同的对话框之后,它似乎也没有被删除。如果我对其中任何一个陈述有误,请纠正我。