Bootstrap 모드 상자 사례 분석
<td width="120px">
<button type="button class="btn btn-blue" style="width: 100px;"
data-toggle="modal" data-target="#systemAdd"> </button></td>
<!-- --> </aside>
<div class="modal fade" id="systemAdd" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header modal-header-blue">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
<h4 class="modal-title"> </h4>
</div>
<div class="modal-body text-center">
<form role="form-horizontal"
action="${ctx}/system/addSystemUser.xht" method="post"
id="addForm">
<div class="form-group">
<label for="name"> ID</label> <input type="text"
class="form-control" id="userId0" name="userId"
placeholder=" ID">
</div>
<div class="form-group">
<label for="name"> </label> <input type="text"
class="form-control" id="userPwd" name="userPwd"
placeholder=" ">
</div>
<div class="form-group">
<label for="name"> ID</label> <input type="text"
class="form-control" id="systemCode" name="systemCode"
placeholder=" ID">
</div>
<div class="form-group">
<label for="name"> </label> <select class="form-control "
id="superFlg" name="superFlg">
<option value="0"> </option>
<option value="1"> </option>
</select>
</div>
<div class="form-group">
<label for="name"> </label> <select class="form-control "
id="delFlg" name="delFlg">
<option value="0"> </option>
<option value="1"> </option>
</select>
</div>
<div class="form-group">
<label for="name"> </label>
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" placeholder=" "
data-date-format="YYYY-MM-DD HH:mm:ss" id="createTime"
name="createTime" /> <span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-blue" data-dismiss="modal"
onclick="addSystemUser()"> </button>
<button type="button" class="btn btn-default"
data-dismiss="modal"> </button>
</div>
</div>
</div>
</div>
둘째,또 하 나 는 편집 입 니 다.이때 모드 상 자 를 팝 업 할 때 안에 데 이 터 를 기록 해 야 하기 때문에 데 이 터 를 얻 은 다음 모드 상 자 를 팝 업 해 야 합 니 다.이 때 js 코드 제어 추가1.jsp 페이지
<td width="120px">
<button type="button "
class="btn btn-green" style="width: 100px;"
onclick="updateSystemUser()"> </button></td>
<div class="modal fade" id="systemUpp" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header modal-header-green">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
<h4 class="modal-title"> </h4>
</div>
<div class="modal-body text-center">
<form role="form-horizontal"
action="${ctx}/system/updateUser.xht" method="post"
id="modifyForm">
<div class="form-group" hidden="hidden">
<label for="name">NO</label> <input type="text"
class="form-control" id="no1" name="no" readonly>
</div>
<div class="form-group" hidden="hidden">
<label for="name"> ID</label> <input type="text"
class="form-control" id="userId1" name="userId" readonly
placeholder=" ID">
</div>
<div class="form-group">
<label for="name"> </label> <input type="text"
class="form-control" id="userName1" name="userName"
placeholder=" ">
</div>
<div class="form-group" hidden="hidden">
<label for="name"> </label> <input type="text"
class="form-control" id="userPwd1" name="userPwd"
placeholder=" ">
</div>
<div class="form-group">
<label for="name"> ID</label> <input type="text"
class="form-control" id="systemCode1" name="systemCode"
placeholder=" ID">
</div>
<div class="form-group" hidden="hidden">
<label for="name"> </label> <select class="form-control "
id="superFlg1" name="superFlg">
<option value="0"> </option>
<option value="1"> </option>
</select>
</div>
<div class="form-group">
<label for="name"> </label> <select class="form-control "
id="delFlg1" name="delFlg">
<option value="0"> </option>
<option value="1"> </option>
</select>
</div>
<div class="form-group" hidden="hidden">
<label for="name"> </label>
<div class='input-group date' id='datetimepicker3'>
<input type='text' class="form-control"
data-date-format="YYYY-MM-DD HH:mm:ss" id="createTime1"
name="createTime" placeholder=" " /> <span
class="input-group-addon"> <span
class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-green" data-dismiss="modal"
onclick="modifySystemUser()"> </button>
<button type="button" class="btn btn-default"
data-dismiss="modal"> </button>
</div>
</div>
</div>
</div>
2.js 코드
/**
* ( )
*/
function updateSystemUser() {
var tempInput = new Input();
tempInput.userId = $('input[name="userId"]:checked').val();
if (tempInput.userId == null) {
alert(" ");
} else {
var params = JSON2.stringify(tempInput);
var url = "/emailplatform/system/selectOneUser.xht";
ajaxJson(url, true, params, function(reObject) {
//
var dialog = $('#systemUpp').modal({
backdrop : 'static',
keyboard : false
});
dialog.modal('show');
if (reObject) {
$("#no1").val(reObject.data.no);
$("#userId1").val(reObject.data.userId);
$("#userName1").val(reObject.data.userName);
$("#userPwd1").val(reObject.data.userPwd);
$("#systemCode1").val(reObject.data.systemCode);
$("#superFlg1").val(reObject.data.superFlg);
$("#delFlg1").val(reObject.data.delFlg);
$("#createTime1").val(reObject.data.createTime);
}
});
}
}
위 에서 말 한 것 은 소 편 이 여러분 에 게 소개 한 Bootstrap 모드 상자 사례 분석 입 니 다.여러분 에 게 도움 이 되 기 를 바 랍 니 다.궁금 한 점 이 있 으 시 면 저 에 게 메 시 지 를 남 겨 주세요.소 편 은 제때에 답 해 드 리 겠 습 니 다!