2023-05-16 10:47:08 +08:00

34 lines
892 B
JavaScript

$(function()
{
$('.objectType').click(function()
{
if($(this).prop('checked'))
{
$(this).closest('tr').find(':checkbox').prop('checked', true);
}
else
{
$(this).closest('tr').find(':checkbox').prop('checked', false);
}
});
$('.messageType').click(function()
{
var index = $(this).closest('th').index();
if($(this).prop('checked'))
{
$(this).closest('table').find('tbody').find('tr').each(function()
{
$(this).find('td').eq(index).find(':checkbox').prop('checked', true);
})
}
else
{
$(this).closest('table').find('tbody').find('tr').each(function()
{
$(this).find('td').eq(index).find(':checkbox').prop('checked', false);
})
}
});
});