admin-user.js
551 字节
$(function () {
$(".role_id").on('ifChecked', function(event) {
changeRole($(this).val());
});
});
$(".role_id").each(function () {
console.log($(this).is(':checked'));
if (true == $(this).is(':checked')) {
changeRole($(this).val());
}
});
/**
* 角色选择功能
*
* @returns {boolean}
* @param role_id
*/
function changeRole(role_id)
{
if (role_id == 4) {
$(".role_id").closest('.form-group').next().show();
} else {
$(".role_id").closest('.form-group').next().hide();
}
}