123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- /**********************************************************************************
- * modular_controller.js
- *
- * Modular 프레임워크의 컨트롤러와 관련된 부분이 포함되어 있는 스크립트 파일
- * 'Modular.controller' 라는 네임스페이스를 사용하고 있음
- *
- * @author 김선엽(sunyoupk@udapsoft.co.kr)
- **********************************************************************************/
- Modular.controller.Page = {};
- Modular.controller.Page.gotoPage = function (searchId, pageNum) {
- var target = jQuery("form#" + searchId);
- var type = target.attr("modular:type");
- if (type == "search") {
- /*
- * 현재 페이지 설정
- */
- var pageForm;
- var temp = jQuery("input[name='modular.condition.currentPage']", target);
- if (temp.size() > 0) {
- pageForm = temp;
- } else {
- pageForm = jQuery("<input type=\"hidden\" name=\"modular.condition.currentPage\" />");
- target.append(pageForm);
- }//end if else
- pageForm.val(pageNum);
-
- /*
- * 정렬 조건 설정
- */
- var orderForm;
- temp = jQuery("input[name='modular.dao.order.key']", target);
- if (temp.size() > 0) {
- orderForm = temp;
- } else {
- orderForm = jQuery("<input type=\"hidden\" name=\"modular.dao.order.key\" />");
- target.append(orderForm);
- }//end if else
- if (Modular.Utils.hasText(Modular.model.PageContext.navigation.orderParam)) {
- orderForm.val(Modular.model.PageContext.navigation.orderParam);
- }//end if
-
- /*
- * 조회 조건 설정
- */
- var conditionForm = Modular.view.Form.findSearchParametersObj(target);
- if (Modular.Utils.hasText(Modular.model.PageContext.navigation.search)) {
- conditionForm.val(Modular.model.PageContext.navigation.search);
- }//end if
-
- Modular.model.PageContext.popSearchForm = false;
- target.submit();
- }//end if
- };
- Modular.controller.Sort = {
- ASC : "ascending",
- DESC : "descending"
- };
- Modular.controller.Sort.sort = function (searchId, sortId, sortOrder) {
- var target = jQuery("form#" + searchId);
- var type = target.attr("modular:type");
- if (type == "search") {
- var order = {
- id : sortId,
- direction : sortOrder
- };
- var orders = [];
- orders.push(order);
- var orderForm;
- var temp = jQuery("input[name='modular.dao.order.key']", target);
- if (temp.size() > 0) {
- orderForm = temp;
- } else {
- orderForm = jQuery("<input type=\"hidden\" name=\"modular.dao.order.key\" />");
- target.append(orderForm);
- }//end if else
- orderForm.val(Modular.Utils.toJSON(orders));
- var conditionForm = Modular.view.Form.findSearchParametersObj(target);
- if (Modular.Utils.hasText(Modular.model.PageContext.navigation.search)) {
- conditionForm.val(Modular.model.PageContext.navigation.search);
- }//end if
-
- Modular.model.PageContext.popSearchForm = false;
- target.submit();
- }//end if
- };
|