123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- /**
- * @group :
- * @ver : 2009.12.19
- * @by : 박구순
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 화면을 초기화 한다
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitalize(){
- model.removeNodeSet("/root/main/abbrsyreclists");
- var vAbbrcd = opener.javascript.getParameter("SPMRJ01900_abbrcd");
- if(vAbbrcd==""){
- messageBox("약어코드 정보가 없습니다.","I003");
- return;
- }else{
- model.setValue("/root/send/abbrcd",vAbbrcd);
- model.setValue("/root/init/abbrcd",vAbbrcd);
- fSelectAbbrSyRecList();
- }
- }
- function fSelectAbbrSyRecList(){
- submit("TRMRT01801");
- }
- function fSelectAbbrMasterLists(){
- model.setValue("/root/send/abbrtype" ,model.getValue("/root/init/abbrtype"));
- model.setValue("/root/send/abbrkind" ,model.getValue("/root/init/abbrkind"));
- model.setValue("/root/send/perfectyn",model.getValue("/root/init/perfectyn"));
- model.setValue("/root/send/useyn" ,model.getValue("/root/init/useyn"));
- model.setValue("/root/send/keyword" ,model.getValue("/root/init/keyword"));
- if(ipt_keyword.value.length < 2){
- messageBox("검색어는 2자 이상 입력해야 가능 합니다. ","I007");//I007=확인하십시오.
- return;
- }
- model.setValue("/root/send/keytag" ,model.getValue("/root/init/keytag"));
- submit("TRMRT00801");
- }
- /**
- * 그리드 행추가 버튼을 클릭하였을 경우 이벤트
- *
- */
- function fClickRowAddBtn(){
- grd_list.addRow(); // 입력할 행 추가.
- var cur_row = grd_list.row; // 추가된 행 번호 가져오기
- grd_list.valueMatrix(cur_row, 4) = model.getValue("/root/init/abbrcd");
- grd_list.valueMatrix(cur_row, 5) = model.getValue("/root/init/trgtflag");
-
- }
- /*
- * 저장 버튼을 클릭하였을 경우 이벤트
- *
- */
- function fOnClickSaveBtn(){
- if(!checkGridUpdate(grd_list)){
- alert("저장할 자료가 존재하지 않습니다.");
- return;
- }
- if(checkGridField(grd_list,"trgtcnts")==false){
- alert("데이터중에 비어있는 필수필드가 있습니다.");
- return;
- }
- model.makeValue("/root/send/listdata",grd_list.getUpdateData());
- if ( submit("TXMRT01802") ) {
- // grd_list.clearStatus(); // submit() 성공하면 그리드의 i,u,d 상태 제거
- // fSelectAbbrSyRecList();
- fClose();
- }
- }
- /**
- * 삭제 버튼을 클릭하였을 경우 이벤트
- *
- */
- function fClickDeleteBtn(){
- var cur_row = grd_list.row; // 행 번호 가져오기
- var iStatus = grd_list.rowstatus(cur_row);
- if(cur_row <= 0 || cur_row =="undefined") {
- alert("삭제할 행을 선택하시기 바랍니다...");
- return;
- }
- if (iStatus == 1 || iStatus == 3){ // 새로 삽입된 행이면
- grd_list.deleteitem(cur_row);
- }else if (iStatus == 4){ // 삭제로 표시된 행이면
- grd_list.removestatus(cur_row, "delete");
- }else{
- grd_list.addStatus(cur_row, "delete");
- }
- }
- function fSelectedAdd(){
- var grdRows = grd_abbrLists.rows;
- if(0 == grdRows){return;}
-
- for(i=1; i< grdRows;i++)
- {
- var selectValue = grd_abbrLists.valueMatrix(i,1);
- if(selectValue=="true")
- {
- var vTrgtcd = grd_abbrLists.valueMatrix(i,3);
- var vTrgtcnts = grd_abbrLists.valueMatrix(i,4);
- if('-1' != grd_list.findRow(vTrgtcd, 0, 1, false, true)){
- messageBox(vTrgtcnts+"은(는) 이미 등록되었가나 추가된 약어코드 입니다. ","I007");//I007=확인하십시오.
- }else{
- grd_list.addRow(); // 입력할 행 추가.
- var cur_row = grd_list.row; // 추가된 행 번호 가져오기
- grd_list.valueMatrix(cur_row, 1) = vTrgtcd;
- grd_list.valueMatrix(cur_row, 2) = vTrgtcnts;
- grd_list.valueMatrix(cur_row, 4) = model.getValue("/root/init/abbrcd");
- grd_list.valueMatrix(cur_row, 5) = model.getValue("/root/init/trgtflag");
- }
- grd_abbrLists.valueMatrix(i,1) = 'false';
- }
- }
- }
- /**
- * @group :
- * @ver : 2006.12.20
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @return : bool
- * @---------------------------------------------------
- */
- function checkGridUpdate(grid)
- {
- var iData = grid.getUpdateDataXml("insert");
- var uData = grid.getUpdateDataXml("update");
- var dData = grid.getUpdateDataXml("delete");
- if (iData=="" && uData=="" && dData=="") return false;
- else return true;
- }
- /**
- * @group :
- * @ver : 2006.12.20
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @return : bool
- * @---------------------------------------------------
- */
- function checkGridField(grid, field){
- var nodeset = grid.nodeset;
- var iStatus;
- //var iData = grid.getUpdateDataXml("insert");
- for (i=grid.fixedRows; i<grid.rows; i++){
- iStatus = grid.rowstatus(i);
- if (iStatus == 1 || iStatus == 3){
- var fieldArr = field.split("▦");
- if(fieldArr.length < 1){
- return false;
- }
- for(var j = 0; j < fieldArr.length; j++){
- if(fieldArr[j] == null || fieldArr[j] == "" || fieldArr[j] == "undefined"){
- continue;
- }
- if(model.getValue(nodeset+"["+i+"]/"+fieldArr[j])=="") return false;
- }
- }
- }
- return true;
- }
- function fClose(){
- window.close();
- }
|