//----------------------★그리드의 전체체크
<!--//</instance>밑에//-->

<script type="javascript" ev:event="xforms-ready">
 <![CDATA[
  
//캡션 영역에 체크박스를 설정한다
  datagrid1.fixedcellcheckbox(0, datagrid1.colRef("save"), false) = true;
 ]]>
</script>

//그리드안의col도
<col ref="save" type="checkbox"/>

//----------------------★그리드의 컬럼,데이터들 문자열숨김
ellipsis = true;
//(CSS에 적용하려면 ellipsis : true;)

//----------------------★그리드의 마지막컬럼을 width에 딱맞게
extendlastcol = scroll;
//(CSS에 적용하려면 extendlastcol : scroll;)


//----------------------★radio컨트롤의 switch사용
<switch id="switch1" style="left:30px; top:30px; width:205px; height:70px; "> 
   <case id="case1" selected="true"> 
       <input id="input1" style="left:50px; top:25px; width:100px; height:20px; "/> 
   </case> 
   <case id="case2"> 
       <button id="button1" style="left:45px; top:25px; width:100px; height:20px; "> 
           <caption>button1</caption> 
       </button> 
   </case> 
</switch>

 <select1 id="select11" ref="/root/select" appearance="minimal" style="left:250px; top:35px; width:100px; height:20px; "> 
  <choices> 
      <item> 
          <label>case1</label> 
         <value>1</value> 
      </item> 
      <item> 
          <label>case2</label> 
          <value>2</value> 
      </item> 
  </choices> 
  <script type="javascript" ev:event="xforms-select"> 
      <![CDATA[ 
      if ( root.select.text == 1 ) 
      { 
          model.toggle("case1"); 
      } 
      else if ( root.select.text == 2 ) 
      { 
          model.toggle("case2"); 
      } 
      ]]> 
  </script> 
 </select1>


//----------------------★datagrid컨트롤의 핸드폰번호output의 출력방법(999-9999-999)
for(var i = 1 ;  i <= model.getValue("/dbio_total_count_") ;i++)
{ 
 
//alert(model.getValue("/root/dis/data/dis_CnncIntMPatMultiDto/CnncIntMPatListDto/cnncIntMPatDTO["+i+"]/thmoRvnRt"));
 jc_datagrid.valueMatrix(i,col) = "";
}
//for
 /*parseFloat(numstring) 
 numstring 인수는 부동 소수점 숫자를 포함한 문자열입니다.  
 parseFloat 메서드는 numstring에 포함되어 있는 숫자에 해당하는 숫자 값을 반환합니다. 
 numstring의 접두사를 부동 소수점 숫자로 구문 분석할 수 없으면 NaN(숫자 아님)이 반환됩니다. 
 parseFloat("abc")    // NaN을 반환합니다.
 parseFloat("1.2abc") // 1.2를 반환합니다.
 */

//----------------------★input컨트롤의 format을 정하고싶을때

 input1.attribute("format") = "999999-9999999";
 input1.refresh();
 
 

//----------------------★라디오버튼이바뀔때 초기화
<script type="javascript" ev:event="xforms-value-changed">
 <![CDATA[       
  if (radio1.value == 1) 
  { 
   model.resetInstanceNode("/root/dis/data/dis_CsSrchInListDTO/csSrchInDTO");
   model.refresh();
  } 
  else if (radio1.value == 2) 
  { 
   model.resetInstanceNode("/root/dis/data/dis_CsSrchInListDTO/csSrchInDTO");
   model.refresh();
  }   
 ]]>
</script> 
 
 
 
//----------------------★엔터키이벤트
<script type="javascript" ev:event="onkeyup">
 <![CDATA[
  if(event.keyCode == 13) 
  {
   model.setFocus("button1");
   button1.dispatch("DOMActivate");
  }
 ]]>
</script>
 


<!-- 체크박스 라디오 이미지를 쓰시오 checkimage="checkedRadioImage.bmp" uncheckimage="unCheckedRadioImage.bmp"-->


//----------------------★그리드 저장버튼 클릭 시 빈 row 삭제 코드
var _grid = datagrid1;      //그리드 ID

for(var i=_grid.rows-_grid.fixedRows; i>=_grid.fixedRows; i--) 
{
 var nodePath = _grid.nodeset+"["+i+"]/*";
 if(model.getXPathValue("count-non-empty("+nodePath+")") == "0") 
 {
  _grid.deleteRow(i, false);
 }
}
_grid.refresh();


//----------------------★switch tab button
<!--//스위치//-->
<switch id="switch1" style="left:25px; top:25px; width:960px; height:500px; ">
 <case id="case1" selected="true">
  <iviewer id="iviewer1" src="JC60301_btn1.xrw" style="left:0px; top:0px; width:100%; height:600px; "/>
 </case>
 <case id="case2">
  <iviewer id="iviewer2" src="JC60301_btn2.xrw" style="left:0px; top:0px; width:100%; height:600px; "/>
 </case>
</switch>
<!--//스위치//-->


//----------------------★그리드의 체크
//save 하지 않을 행들을 확인한다 (체크되지 않은 행들)
var exportfalserows = "";
for(var i=datagrid1.fixedRows;i<datagrid1.rows;i++)
{
 if(datagrid1.valueMatrix(i, datagrid1.colRef("save")) == "false")
 {
  if(exportfalserows != "")
   exportfalserows += ","+i;
  else
   exportfalserows += i;
 }
}


//----------------------★콤보-공통코드 일부만 셋팅하기
combo1.nodeset="/root/comboData/masterNm/item[value='01' or value='02' or value='03']"

//01로 시작하는 item의 필터링 xpath식은 아래와 같이 해주시면 됩니다.
item[starts-with(value, '01')]

/*
위와 같이 해 주시면 01로 시작하는 item만을 가져올 수 있고, 
두번째 질문과 같이 시작하는 문자가 정해져 있지 않다면
위의 xpath식의 빨간 색 부분을 미리 변수에 담아두어서 콤보의 nodeset을 동적으로 바꿔주시면 됩니다.
*/

var str = "G";

combo1.choices.itemset.attribute("nodeset") = "/root/comboData/item[starts-with(value, '" + str + "')]";


//----------------------★데이터그리드 숫자row
rowheader="seq"

//----------------------★데이터그리드 merge하기(같은속성-데이터,컬럼,타이틀끼리)
mergecells="byrowrec"

/* bycol : 상하만 머지를 한다.
 byrow : 좌우만 머지를 한다.
 bycolrec : 상하좌우를 모두 머지한다. 상하 머지를 우선 적용한 후 좌우 머지를 한다.
 byrowrec : 상하좌우를 모두 머지한다. 좌우 머지를 우선 적용한 후 상하 머지를 한다.
 byrestriccol : 상하만 머지를 한다. 첫번째 열부터 순서대로 머지를 한다. 머지를 할 영역은 이전 열의 머지 결과에 의해 결정된다.
 byrestricrow : 좌우만 머지를 한다. 첫번째 행부터 순서대로 머지를 한다. 머지를 할 영역은 이전 행의 머지 결과에 의해 결정된다
*/

//----------------------★데이터그리드의 데이터의 내용에 따라 높이 자동조절(텍스트가 길어지면 다음줄로)

autoresize="true"
//셀 내용의 길이에 따라 행의 높이를 자동으로 조절하도록 설정하는 속성


//----------------------★데이터그리드 부분합계구하기
datagrid1.subtotalposition="below"; 
//추가된 행의 위치는 
   "above": 상단에 삽입
   "below": 하단에 삽입

//datagrid.subtotal(SubtotalType type, Integer groupColumn, Integer totalColumn, [String format], [String style], [Integer captionColumn], [String caption], [Boolean fillText]);

/*
SubtotalType type : sutotal 타입 
     - "average" : 평균 값
     - "clear" : 모든 subtotals를 클리어 한다.
     - "count" : 행의 갯수
     - "max" : 가장 큰 값
     - "min" : 가장 작은 값
     - "percent" : 모든 더해진 값의 퍼센트
     - "sum" : 더한 값
Integer groupColumn : subtotal 계산을 할 때 데이터를 분류하는 기준이 되는 열의 index 
Integer totalColumn : subtotal 을 수행할 값들이 있는 열의 index 
[String format] : subtotal 행의 포맷 
[String style] : subtotal 행의 스타일 
[Integer captionColumn] : subtotal 행의 제목을 표시할 열의 index. default 는 groupColumn 과 동일하다.
[String caption] : subtotal 행의 제목. default 는 groupColumn 의 이전행의 텍스트와 동일하다. 
[Boolean fillText] : 첫번째 열부터 그룹 열 전까지 이전 행의 텍스트를 subtotal 행에 복사할 지 여부. true 로 설정되면 이전 행의 데이터가 복사되어 merge 상태가 이어질 수 있다. default 는 false (이전행의 값을 복사하지 않음) 
     - true
     - false 
*/ 


//----------------------★탭버튼 그룹으로 관리하기
group="case1" 
//group이 같은 버튼들 중 하나가 선택 되면 다른 버튼들은 선택이 해제된다.

groupalign="user"   
/*그룹 버튼들의 모양을 지정하는 속성이다.
top 으로 설정하면 페이지의 위쪽에 적용할 수 있는 모양으로 자동으로 바뀌고, bottom 으로 설정하면 페이지의 아래쪽에 적용할 수 있도록 모양이 바뀌게 된다
*/

//----------------------★창 열때 윈도우사이즈 고정하기
//창 사이즈고정
window.width = "500";
window.height = "500";

//----------------------★데이터그리드 특정  컬럼만 이벤트 실행
<script type="javascript" ev:event="onclick">
 <![CDATA[
  if(datagrid1.isCell(event.target))  
  {
   if(datagrid1.col == "8")          
   {
    alert("팝업열기");
    
   }
  }
 ]]>
</script> 


//----------------------★데이터그리드 헤더 타이틀 줄바꿈
해당그리드의 col선택하고 Alt + Enter

단위&#xA;(원)
(Alt + Enter)치면 된다
//"\n"


//----------------------★데이터그리드 로딩시 설정
//컬럼체크박스bool
datagrid1.fixedcellcheckbox(0,0) = true;   
   
//로딩시그리드빈줄삭제
model.removeNodeset(datagrid1.nodeset);
//datagrid1.deleteRow(datagrid1.fixedRows);


//----------------------★컨트롤에 단축키 지정하기
accesskey="ctrl+a"
/*
지정된 컨트롤에 접근하기 위한 단축키를 설정할 수 있다.
기본적으로 accesskey 속성에 지정한 키를 누르면 해당 컨트롤에 onaccesskey 이벤트와 DOMActivate 이벤트가 순차적으로 발생한다.
형식 : [namedkey | keycode()] + …
* named key
insert, delete, home, pageup, pagedown, end, backspace, pause, print, enter, tab, escape, up, down, left, right, ctrl, alt, shift
f1..f12, 0..9, a..z  (a..z 는 대소문자 구분없이 사용하고, alt 키는 지원하지 않는다)
* keycode function
keycode(code) : 주의 keycode() 에서 keycode 와 ( 를 붙여 써야한다.
*/

//----------------------★그리드 컬럼 정렬하기
datagrid.colsort(0) = "asc";
/*"asc" : 오름차순으로 소팅되도록 설정
- "desc" : 내림차순으로 소팅되도록 설정
- "none" : 소팅대상에서 제외되도록 설정 
*/

//----------------------★그리드 정렬
explorerbar 
/* sort : 사용자가 열의 헤더를 클릭, 각 열의 데이터를 정렬 할 수 있다.
ㅁ move : 사용자가 열의 헤더를 드래그하여 위치를 재배열 할 수 있다.
ㅁ sortshow : sort 기능을 하며 헤더에 작은 화살표시로 정렬 방식을 표현 (오름차순, 내림차순)
ㅁ sortmove : sort, move 기능을 동시에 한다.
ㅁ sortshowmove : shortshow, move 의 기능을 동시에 한다.
*/


//----------------------★그리드 정렬후 이벤트
<script type="javascript" ev:event="onaftersort">
     <![CDATA[
      
//정렬해도 인덱스 맞게 가져오는
      datagrid1.gridToInstance();  
     ]]>
</script>


//----------------------★후처리시 조건값에 따라 그리드 체크박스 disabled처리
for(var i=1; i<datagrid1.rows; i++)
{
 datagrid1.isReadOnly(i, 0, i, 0) = true;
 
//datagrid.isReadOnly(row(줄시작점),col(컬럼시작점),row(줄끝점),col(컬럼끝점) = true; 
}



//----------------------★콤보에 선택된 인덱스 반환
var index = combo1.focusIndex;
/*리스트DTO의 값을 단일DTO로 value값을 넣어줘야할 때 유용하게 
현재 포커스를 가진 아이템의 인덱스를 반환한다.  초기에는 focusIndex가 -1로 셋팅 되어 있다. 
포커스가 다른 컨트롤로 이동하더라도 combo의 focusIndex는 마지막에 포커스가 간 아이템의 인덱스를 저장한다 
*/

ex)
<script type="javascript" ev:event="xforms-value-changed">
      <![CDATA[
       var index = companyCb.focusIndex + 1;
       
//instance는 1부터 시작하니까

       msgNm.value = companyCb.label;       
       msgCtText.value = model.getValue("/root/dis/data/dis_ShmsMagListDTO/shmsMagDTO["+index+"]/msgCt");
       //msgCtText.value = companyCb.value;
       
       model.refresh();
      ]]>
     </script>


//----------------------★인스턴스 보기
// 인스턴스 보기
window.viewInstance();


//----------------------★그리드 타이틀 사이즈 셋팅
// 인스턴스 보기
datagrid1.rowHeight(1) = 40;
/*그리드 특정 행의 높이 값을 설정하거나 반환한다.
데이터 행과 fixed row 모두 제어가 가능하다.
rowHeightMax property 와 rowHeightMin property 에 설정되어 있는 최대 최소 값 범위 내에서 설정을 해야 하면, 
이 범위를 벗어났을 경우에는 최대 또는 최소 값으로 설정이 된다*/


'트러스트폼' 카테고리의 다른 글

트러스트폼 이벤트  (0) 2012.07.12
트러스트폼 버튼 엑션(늘리고 줄이고)  (0) 2012.07.12
트러스트폼 단축키  (0) 2012.07.12
트러스트폼 엘리멘트  (0) 2012.07.12
트러스트폼 xml 기본 문법  (0) 2012.07.12
Posted by 사라링
BLOG main image
.. by 사라링

카테고리

사라링님의 노트 (301)
JSP (31)
J-Query (41)
JAVA (24)
VM-WARE (0)
디자인패턴 (1)
스크랩 (0)
스트러츠 (3)
안드로이드 (11)
오라클 (45)
우분투-오라클 (1)
이클립스메뉴얼 (6)
스프링3.0 (23)
자바스크립트 (10)
HTML5.0 (17)
정보처리기사 (1)
기타(컴퓨터 관련) (1)
문제점 해결 (3)
프로젝트 (2)
AJAX (4)
하이버네이트 (3)
트러스트폼 (11)
Jeus (2)
재무관리(회계) (5)
정규식 (5)
아이바티스 (8)
취미 (2)
소프트웨어 보안 관련모음 (0)
정보보안기사 (6)
C언어 베이직 및 프로그램 (3)
보안 관련 용어 정리 (2)
넥사크로 (6)
Total :
Today : Yesterday :