* Finish task #7234.

This commit is contained in:
sgm0422
2020-06-10 14:10:09 +08:00
parent b25f67c5ba
commit 4fbd9f6fd2
11 changed files with 235 additions and 8 deletions
+27
View File
@@ -0,0 +1,27 @@
function addItem(obj)
{
var $currentRow = $(obj).closest('tr');
var $newRow = $currentRow.clone().addClass('highlight');
$currentRow.after($newRow);
$newRow.find('th').text('');
$newRow.find('div[id^=members], div[id^=program]').remove();
$newRow.find('select[name^="members"], select[name^="program"]').val('').chosen();
setTimeout(function()
{
$newRow.removeClass('highlight');
}, 1600);
}
function deleteItem(obj)
{
var $currentLine= $(obj).closest('tr');
$currentLine.remove();
}
function resetProgramName(obj)
{
var programSelect = $(obj).closest('tr').find('select[name^="program"]');
var newName = 'program[' + $(obj).val() + '][]';
programSelect.attr('name', newName);
}