PropertyEventMethod찾아보기
WebSquare.uiplugin.fwGanttChart - 5.0_1.3521B.20190311.114514

fwGanttChart는 FusionWidget Wrapper 컴포넌트입니다. FusionWidgets의 데이터는 실제 차트에 보여줄 값과 스타일 옵션들이 하나로 결합되어 있는 형태입니다. WebSquare5에서는 이를 분리하여 차트를 쉽게 Customizing 할 수 있도록 API를 지원합니다. 각 차트에 대한 자세한 Properties & API는 FusionCharts 공식 홈페이지를 참조하시기 바랍니다. http://docs.fusioncharts.com/charts/

Type

uiplugin

Property Summary

autoCategory
fwGanttChart에 category를 자동생성하는 옵션
categoryDepth
fwGanttChart에 category를 auto로 생성시 category depth를 설정
dataColumns
[default:""] datatable에 사용할 컬럼의 ID를 지정. (","로 구분하여 여러 개 지정 가능.)
dateformat
fwGanttChart에 사용할 날짜포맷을 설정함
endDateNode
fwGanttChart에 dataList 연동시 endDateNode로 사용할 columnid값
id
컴포넌트 id
monthNames
fwGanttChart에 category 생성시 필요한 monthName 설정
multiTasks
fwGanttChart에 multiTasks 사용여부 설정
plotColor
fwGanttChart에 task들의 색상을 지정함
processNode
fwGanttChart에 dataList 연동시 processNode로 사용할 columnid값
quarterNames
fwGanttChart에 category 생성시 필요한 quarterNames 설정
ref
fwGanttChart와 dataList 바인딩시 사용하는 옵션
resizeLastMonth
[default:false, true] timeBase="date"이고 categoryDepth="2"인 경우, 마지막 카테고리에 속하는 2-depth의 컬럼 수에 따라 폭을 조절.
startDateNode
fwGanttChart에 dataList 연동시 startDateNode로 사용할 columnid값
taskIdNode
fwGanttChart에 dataList 연동시 taskIdNode로 사용할 columnid값
taskNode
fwGanttChart에 dataList 연동시 taskNode로 사용할 columnid값
timeBase
fwGanttChart에 사용할 timebase를 설정함
timeGap
fwGanttChart에 category를 auto로 생성시 시간간격설정
version
fusionChart에서 사용할 버전

Event Summary

Method Summary

addCategories( fwGanttChart )
fwGanttChart의 Catagories를 추가한다
addClass( className )
컴포넌트에 class를 추가한다
bind( eventType , function )
컴포넌트의 이벤트를 동적으로 할당한다
changeClass( oldClassName , newClassName )
컴포넌트에서 oldClassName의 이름을 가진 class를 newClassName으로 변경한다.
draw( )
fwGanttChart를 화면에 출력합니다
exportJSChart( type )
fwGanttChart를 jpg,png,pdf형식으로 export하는 함수입니다
fc( )
fwGanttChart타입의 fusionWidget 객체를 반환합니다
focus( )
컴포넌트에 focus를 준다
getChartAttribute( name )
fwGanttChart의 attribute값을 반환합니다
getDisabled( )
현재 설정되어있는 disabled 속성값을 반환한다
getGenerator( )
generator 하위의 컴포넌트에서 이 함수를 호출하여 자신을 생성한 부모 generator 객체를 가져온다
getID( )
웹스퀘어 컴포넌트의 id를 반환한다
getJSONData( )
fwGanttChart의 차트데이터를 JSON객체를 반환합니다
getOpacity( )
CSS로 정의 된 컴포넌트의 Opacity(불투명도) 값을 반환한다
getPluginName( )
웹스퀘어 컴포넌트의 pluginName(컴포넌트명)을 반환한다
getPosition( positionName )
컴포넌트의 left 또는 top의 위치 값을 반환한다
getReadOnly( )
현재 설정되어있는 readOnly 속성값을 반환한다
getSize( sizeName )
컴포넌트의 크기 값을 반환합니다
getStyle( propertyName )
컴포넌트에 적용 된 CSS의 propertyName에 해당하는 값을 반환한다
getStyleValue( style )
[deprecated]getStyle로 사용.
getSVGString( )
차트로부터 SVG를 string 형태로 반환한다
getTitle( )
title 속성값을 반환한다
getUserData( key )
setUserData API로 설정 된 사용자 데이터 또는 소스(화면 XML)에 사용자가 임의의 property로 정의 된 값을 반환한다
hasClass( className )
컴포넌트가 parameter로 받은 className의 class를 가지고 있는지의 여부를 반환한다
hide( )
컴포넌트를 화면에서 보이지 않도록 숨긴다.
removeClass( className )
컴포넌트에 className의 class를 삭제한다.
setCategories( fwGanttChart )
fwGanttChart의 Catagories를 설정한다
setChartAttribute( options )
fwGanttChart의 attribute의 value값을 변경합니다
setConnector( info )
fwGanttChart에서 task 사이를 connector로 연결
setDatatableAttribute( datatable )
fwGanttChart의 datatable에서 사용하는 칼럼의 속성을 설정.
setDisabled( disabled )
컴포넌트의 disabled 속성을 설정한다
setEventPause( evList , flag )
컴포넌트의 이벤트를 disable 또는 enable시킨다
setJSONData( json )
지정된 json 객체로 fwGanttChart의 차트 데이터를 변경합니다
setMilestone( Milestone속성 )
fwGanttChart에 task에 milestone을 지정함
setOpacity( value )
컴포넌트의 CSS Opacity(불투명도)값를 설정한다
setPosition( left , top , mode )
컴포넌트의 위치(left,top)를 설정한다
setProcessesAttribute( process속성 )
fwGanttChart에 processes 속성을 설정함
setReadOnly( readOnly )
readOnly 속성값을 설정한다
setSize( width , heigth )
컴포넌트의 크기(width,height)를 설정한다
setStyle( propertyName , value )
컴포넌트의 property별 style을 설정한다
setTaskAttribute( task속성 )
fwGanttChart에 task에 속성을 지정함
setTasksColor( taskID , color )
fwGanttChart에 task에 개별로 색상을 지정함
setTrendLine( trendLine속성 )
fwGanttChart에 세로라인을 추가함
setUserData( key , value )
컴포넌트에 사용자 데이터를 설정한다
show( displayType )
컴포넌트를 화면에 보이도록 설정한다.
toggleClass( className )
컴포넌트가 className의 이름을 가진 class를 가지고 있다면 제거하고, 가지고 있지 않다면 추가한다.
trigger( type , array )
컴포넌트에 등록 된 특정 이벤트를 발생시킨다
unbind( type , function )
컴포넌트에 등록 된 이벤트를 제거한다
visible( flag )
[deprecated]show/hide 로 사용하거나 setStyle을 통해 visible 속성을 설정한다.

Property Detail

autoCategory
fwGanttChart에 category를 자동생성하는 옵션
categoryDepth
fwGanttChart에 category를 auto로 생성시 category depth를 설정
dataColumns
[default:""] datatable에 사용할 컬럼의 ID를 지정. (","로 구분하여 여러 개 지정 가능.)
(processes와 비슷한 기능이지만, 그래프 왼쪽에 column을 여러 개 삽입할 수 있는 차이점이 있음)
관련 함수: setDatatableAttribute (Datatable에 사용하는 컬럼의 속성을 설정.)
dateformat
fwGanttChart에 사용할 날짜포맷을 설정함
endDateNode
fwGanttChart에 dataList 연동시 endDateNode로 사용할 columnid값
id
컴포넌트 id
monthNames
fwGanttChart에 category 생성시 필요한 monthName 설정
multiTasks
fwGanttChart에 multiTasks 사용여부 설정
plotColor
fwGanttChart에 task들의 색상을 지정함
processNode
fwGanttChart에 dataList 연동시 processNode로 사용할 columnid값
quarterNames
fwGanttChart에 category 생성시 필요한 quarterNames 설정
ref
fwGanttChart와 dataList 바인딩시 사용하는 옵션
resizeLastMonth
[default:false, true] timeBase="date"이고 categoryDepth="2"인 경우, 마지막 카테고리에 속하는 2-depth의 컬럼 수에 따라 폭을 조절.
예를 들어서 차트의 마지막 날짜가 3분기에 해당하는 7월 12일인 경우, 3분기는 카테고리는 7월만 포함하고 폭을 줄임.
true: 폭 조절, false (기본 값): 폭 조절하지 않고, 마지막 카테고리에 속하는 2-depth의 컬럼 수에 상관 없이 이전 카테고리와 동일한 폭을 사용.
startDateNode
fwGanttChart에 dataList 연동시 startDateNode로 사용할 columnid값
taskIdNode
fwGanttChart에 dataList 연동시 taskIdNode로 사용할 columnid값
taskNode
fwGanttChart에 dataList 연동시 taskNode로 사용할 columnid값
timeBase
fwGanttChart에 사용할 timebase를 설정함.
timeGap
fwGanttChart에 category를 auto로 생성시 시간간격설정
version
fusionChart에서 사용할 버전

Event Detail

Method Detail

addCategories( fwGanttChart )
fwGanttChart의 Catagories를 추가한다.
Parameter
nametyperequireddescription
fwGanttChartObjectY카테고리 데이터
Sample
var data = {"category":[ {"start":"02/01/2015","end":"03/31/2015","label":"1분기"}, {"start":"04/01/2015","end":"06/30/2015","label":"2분기"} ] }; fwGanttChart1.addCategories(data);
addClass( className )
컴포넌트에 class를 추가한다.
Parameter
nametyperequireddescription
classNameStringY추가하고 싶은 class의 이름
Sample
//input1 컴포넌트에 oddClass 라는 class를 추가 할 때 input1.addClass("oddClass");
bind( eventType , function )
컴포넌트의 이벤트를 동적으로 할당한다.
Parameter
nametyperequireddescription
eventTypeStringY할당 할 이벤트명.
functionFunctionY동적으로 할당 할 이벤트의 핸들러 function.
Sample
//input1에 onclick 이벤트에 핸들러 function을 직접 정의하여 bind. input1.bind("onclick", function(e){ alert(input1.getValue();})); //input1에 onclick 이벤트에 미리 정의 한 commObj.ev_click function을 bind. var commObj = {}; commObj.ev_click = function(e){ alert("click :: "+this.id); }; input1.bind("onclick", commObj.ev_click );
changeClass( oldClassName , newClassName )
컴포넌트에서 oldClassName의 이름을 가진 class를 newClassName으로 변경한다.
기본 설정은 addClass API를 통해 추가 된 class만 적용되며 컴포넌트의 class 속성에 직접 정의 된 class를 삭제해야하는 경우는 config.xml파일의 설정을 아래와 같이 적용해야한다.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
oldClassNameStringY삭제 할 class의 이름
newClassNameStringY추가 할 class의 이름
Sample
//아래와 같이 input 컴포넌트에 class를 정의 한 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> //config.xml 파일에 아래와 같이 정의. <style> <removeDefaultClass value="true" /> </style> //tmpInputClass class를 tmpInputWarninClass로 변경 input1.changeClass("tmpInputClass","tmpInputWarninClass");
draw( )
fwGanttChart를 화면에 출력합니다.
Sample
fwGaugeChart1.draw();
exportJSChart( type )
fwGanttChart를 jpg,png,pdf형식으로 export하는 함수입니다.
Parameter
nametyperequireddescription
typeStringYexport 타입, 디폴트값:jpg
Sample
fwGanttChart.exportJSChart("pdf");
fc( )
fwGanttChart타입의 fusionWidget 객체를 반환합니다. fusionWidget 객체를 이용해서 fusionWidget 지원하는 Native API를 호출 할 수 있습니다.
Return
typedescription
ObjectFusionWidget 객체
Sample
chart1.fc().getJSONData();
focus( )
컴포넌트에 focus를 준다.
getChartAttribute( name )
fwGanttChart의 attribute값을 반환합니다.
Parameter
nametyperequireddescription
nameStringYattribute 이름
Return
typedescription
Stringattribute 값
Sample
chart1.getChartAttribute("caption");
getDisabled( )
현재 설정되어있는 disabled 속성값을 반환한다.
Return
typedescription
Booleandisabled 속성값
Sample
var returnValue = componentId.getDisabled(); return 예시 ) false
getGenerator( )
generator 하위의 컴포넌트에서 이 함수를 호출하여 자신을 생성한 부모 generator 객체를 가져온다.
Return
typedescription
Object부모 generator 객체
Sample
<w2:generator id="generator1"> <w2:trigger id="trigger1" ev:onclick="scwin.trigger1_onclick"></w2:trigger></w2:generator> scwin.trigger1.onclick = function(){ console.log(this.getGenerator());} // trigger1 클릭 시 generator1 객체가 console에 찍힌다. // https://inswave.com/jira/browse/WPF-1425 참조
getID( )
웹스퀘어 컴포넌트의 id를 반환한다.
Return
typedescription
String웹스퀘어 컴포넌트의 id
Sample
//동적으로 웹스퀘어 컴포넌트를 파라메터로 받았을 경우 아래와 같이 사용 할 수 있다. function fn_validCheck(tmpObj){ //tmpObj가 input1 이라는 ID를 가지고 있는 경우 var compID = tmpObj.getID(); //return 예시 ) "input1" }
getJSONData( )
fwGanttChart의 차트데이터를 JSON객체를 반환합니다.
Return
typedescription
Object차트 데이터
Sample
chart1.getJSONData();
getOpacity( )
CSS로 정의 된 컴포넌트의 Opacity(불투명도) 값을 반환한다.
Return
typedescription
IntegerOpacity 값
Sample
//아래와 같이 input 컴포넌트에 opcacity css를 적용 한 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;opacity:0.2;"></xf:input> var returnValue = input1.getOpacity(); // returnValue는 0~1사이의 실수이다. //return 예시 ) "0.2"
getPluginName( )
웹스퀘어 컴포넌트의 pluginName(컴포넌트명)을 반환한다.
Return
typedescription
String웹스퀘어 컴포넌트의 pluginName
Sample
//아래와 같이 공통 function에서 동적으로 웹스퀘어 객체를 받았을 때 컴포넌트의 종류에 따른 분기처리를 할수 있다. var commObj = {}; commObj.fn_makeReqData = function(tmpObj){ var tmpID = tmpObj.getID(); //컴포넌트 ID var tmpCompType = tmpObj.getPluginName(); //컴포넌트 종류 if(tmpCompType == "input"){ //..로직.. }else if(tmpCompType == "gridView"){ //..로직 .. }else{ //..로직.. } };
getPosition( positionName )
컴포넌트의 left 또는 top의 위치 값을 반환한다. %로 설정된 경우, 픽셀로 변환하여 반환한다.
Parameter
nametyperequireddescription
positionNameStringY[left,top]위치 종류
Return
typedescription
Number컴포넌트의 위치 값
Sample
//아래와 같이 input 컴포넌트에 margin css를 적용했을 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;margin:10px;"></xf:input> var returnValue = input1.getPosition("top"); // returnValue는 픽셀 단위의 위치 값이다. //return 예시 ) 10
getReadOnly( )
현재 설정되어있는 readOnly 속성값을 반환한다.
Return
typedescription
Boolean현재 설정되어있는 readOnly 속성
Sample
var returnValue = componentId.getReadOnly(); //return 예시 ) false
getSize( sizeName )
컴포넌트의 크기 값을 반환합니다.%로 설정된 경우, 픽셀로 변환하여 반환한다.
Parameter
nametyperequireddescription
sizeNameStringY[height,innerHeight,outerHeight,outerMarginHeight,width,innerWidth,outerWidth,outerMarginWidth]크기 값의 종류. szieName별 계산 방법은 아래를 참고.
height : element.clientHeight innerHeight : element.clientHeight + padding outerHeight : element.clientHeight + padding + border outerMarginHeight : element.clientHeight + padding + border + margin width : element.clientWidth innerWidth : element.clientWidth + padding outerWidth : element.clientWidth + padding + border outerMarginWidth : element.clientWidth + padding + border + margin
Return
typedescription
Number컴포넌트의 크기 값
Sample
var returnValue = componentId.getSize("width"); // returnValue는 픽셀 단위의 크기 값이다. %로 설정된 경우, 픽셀로 변환하여 반환한다. //return 예시 ) 100
getStyle( propertyName )
컴포넌트에 적용 된 CSS의 propertyName에 해당하는 값을 반환한다.
Parameter
nametyperequireddescription
propertyNameStringY반환 할 style의 property 이름
Return
typedescription
Stringstyle의 속성값
Sample
//아래와 같이 input 컴포넌트가 정의 된 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;"></xf:input> var returnValue = input1.getStyle("width"); //return 예시 ) "144px"
getStyleValue( style )
[deprecated]getStyle로 사용.
컴포넌트에 적용 된 CSS의 propertyName에 해당하는 값을 반환한다.
Parameter
nametyperequireddescription
styleStringY정의 된 style에서 사용자가 반환 받고자하는 속성명.
Return
typedescription
Stringstyle 속성에 정의 된 값(색을 반환하는 경우에는 색HexCode로 반환)
getSVGString( )
차트로부터 SVG를 string 형태로 반환한다.
Return
typedescription
String전처리된 svg string
getTitle( )
title 속성값을 반환한다.
Return
typedescription
Stringtitle 속성값.
Sample
//아래와 같이 input 컴포넌트에 title이 정의 된 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" title="이름 입력"></xf:input> var tmpTitle = input1.getTitle(); //return 예시 ) "이름 입력"
getUserData( key )
setUserData API로 설정 된 사용자 데이터 또는 소스(화면 XML)에 사용자가 임의의 property로 정의 된 값을 반환한다.
Parameter
nametyperequireddescription
keyStringY임의 데이터의 키
Return
typedescription
Stringkey에 해당하는 데이터
Sample
//아래와 같이 input 컴포넌트의 사용자 속성(eduTest)이 적용 된 경우. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" eduTest="Hello"></xf:input> input1.getUserData("eduTest"); //return 예시 ) "Hello" //setUserData를 통해 set한 경우 input1.setUserData("eduTest","WebSquare"); input1.getUserData("WebSquare"); //return 예시 ) "Hello"
hasClass( className )
컴포넌트가 parameter로 받은 className의 class를 가지고 있는지의 여부를 반환한다.
Parameter
nametyperequireddescription
classNameStringY검색 할 className
Return
typedescription
Booleanclass를 가지고 있는지의 여부
Sample
//아래와 같이 input 컴포넌트에 class가 정의 된 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> var returnValue = input1.hasClass("tmpInputClass"); //return 예시 ) true
hide( )
컴포넌트를 화면에서 보이지 않도록 숨긴다.
엔진 내부적으로는 CSS를 display:none;과 visibility:hidden;으로 처리한다.
Sample
componentId.hide();
removeClass( className )
컴포넌트에 className의 class를 삭제한다.
기본 설정은 addClass API를 통해 추가 된 class만 적용되며 컴포넌트의 class 속성에 직접 정의 된 class를 삭제해야하는 경우는 config.xml파일의 설정을 아래와 같이 적용해야한다.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringY삭제 할 class명
Sample
//아래와 같이 input 컴포넌트에 class를 정의 한 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> //config.xml 파일에 아래와 같이 정의. <style> <removeDefaultClass value="true" /> </style> //tmpInputClass class 삭제 input1.removeClass("tmpInputClass");
setCategories( fwGanttChart )
fwGanttChart의 Catagories를 설정한다.
Parameter
nametyperequireddescription
fwGanttChartObjectY카테고리 데이터
Sample
var data = {"category":[ {"start":"02/01/2015","end":"03/31/2015","label":"1분기"}, {"start":"04/01/2015","end":"06/30/2015","label":"2분기"} ] }; fwGanttChart1.setCategories(data);
setChartAttribute( options )
fwGanttChart의 attribute의 value값을 변경합니다.
Parameter
nametyperequireddescription
optionsObjectY추가할 옵션 객체
Sample
var options = { caption : "Monthly Revenue", subCaption : "subcaption test", xAxisName : "Month", yAxisName:"Revenue" } fwGanttChart1.setChartAttribute(options);
setConnector( info )
fwGanttChart에서 task 사이를 connector로 연결.
Parameter
nametyperequireddescription
infoObjectY연결정보
Sample
var info = { "fromtaskid": "2", "totaskid": "1", "thickness": "2" }; fwGanttChart1.setConnector(info);
setDatatableAttribute( datatable )
fwGanttChart의 datatable에서 사용하는 칼럼의 속성을 설정.
관련 속성: dataColumns (datatable에서 사용할 컬럼의 ID를 지정.)
Parameter
nametyperequireddescription
datatableObjectY속성
Sample
// datatable에서 여러 개의 컬럼을 사용하는 경우 |var obj = { "headerbgcolor": "#999999", "headerfontcolor": "#ffffff", "datacolumn" : [ { "bgcolor": "#eeeeee", "headertext": "ActualStartDate" }, { "bgcolor": "#eeeeee", "headertext": "ActualEndDate" }] }; fwGanttChart1.setProcessesAttribute(info);
setDisabled( disabled )
컴포넌트의 disabled 속성을 설정한다. disabled 속성을 활성화 시키려면 true 비활성화 시키려면 false를 입력한다.
Parameter
nametyperequireddescription
disabledBooleanYdisabled 속성을 활성화 시키려면 true 비활성화 시키려면 false
Sample
//컴포넌트의 disabled 적용 componentId.setDisabled(true);
setEventPause( evList , flag )
컴포넌트의 이벤트를 disable 또는 enable시킨다.
Parameter
nametyperequireddescription
evListStringN대상 이벤트 목록. 해당 인자가 주어지지 않을 경우 해당 컴포넌트의 모든 사용자 이벤트가 대상이 된다. (null을 지정하면 된다.)
flagBooleanYtrue인 경우 pause시키며, false인 경우 pause를 해제한다.
Sample
input1.setEventPause("onclick", true); //onclick이벤트를 동적으로 pause 한다. input1.setEventPause("onfocus,onblur", false); //onfocus이벤트와 onblur이벤트의 pause를 해제한다. input1.setEventPause(null, true); //input에 등록된 모든 사용자 이벤트를 pause 한다.
setJSONData( json )
지정된 json 객체로 fwGanttChart의 차트 데이터를 변경합니다.
Parameter
nametyperequireddescription
jsonObjectY차트 데이터
setMilestone( Milestone속성 )
fwGanttChart에 task에 milestone을 지정함.
Parameter
nametyperequireddescription
Milestone속성ObjectY
Sample
var info = { "date": "05/01/2015", "taskid": "3", "color": "#f8bd19", "shape": "star", "tooltext": "MileStones" }; fwGanttChart1.setMilestones(info);
setOpacity( value )
컴포넌트의 CSS Opacity(불투명도)값를 설정한다.
Parameter
nametyperequireddescription
valueNumberYOpacity 값 (0과 1사이의 실수)
Sample
componentId.setOpacity(0.45);
setPosition( left , top , mode )
컴포넌트의 위치(left,top)를 설정한다.
Parameter
nametyperequireddescription
leftNumberYleft의 값 또는 null.
topNumberYtop의 값 또는 null.
modeStringN[defulat:absolute, delta]absolute이면 x,y로 현재 값을 설정하고 delta이면 현재 값에 x,y값만큼을 더해서 설정.
Sample
//컴포넌트의 top만 100px로 설정. componentId.setPosition(null, 100);
setProcessesAttribute( process속성 )
fwGanttChart에 processes 속성을 설정함.
Parameter
nametyperequireddescription
process속성ObjectY
Sample
var info = { "align":"right", "hoverBandColor":"990000", "isBold":"1", "fontSize":"15" }; fwGanttChart1.setProcessesAttribute(info);
setReadOnly( readOnly )
readOnly 속성값을 설정한다. readOnly 속성을 활성화 시키려면 true 비활성화 시키려면 false를 입력합니다.
Parameter
nametyperequireddescription
readOnlyBooleanYreadOnly 속성을 활성화 시키려면 true 비활성화 시키려면 false
Sample
//컴포넌트의 readonly 적용. componentId.setReadOnly(true);
setSize( width , heigth )
컴포넌트의 크기(width,height)를 설정한다.
Parameter
nametyperequireddescription
widthNumberY새로 설정할 컴포넌트의 width값 또는 null
heigthNumberY새로 설정할 컴포넌트의 height값 또는 null
Sample
//컴포넌트의 height만 100px로 설정. componentId.setSize(null,100);
setStyle( propertyName , value )
컴포넌트의 property별 style을 설정한다.
Parameter
nametyperequireddescription
propertyNameStringYstyle 속성 이름
valueStringY적용 할 style의 값
Sample
//컴포넌트의 width를 200px로 설정 할 경우 componentId.setStyle("width", "200px"); //배경색을 olive로 변경 할 경우 componentId.setStyle("background-color","olive");
setTaskAttribute( task속성 )
fwGanttChart에 task에 속성을 지정함.
Parameter
nametyperequireddescription
task속성ObjectY
Sample
var info = { "fontcolor":"ff0000", "showenddate":"1", "fontSize":"20" }; fwGanttChart1.setTaskAttribute(info);
setTasksColor( taskID , color )
fwGanttChart에 task에 개별로 색상을 지정함.
Parameter
nametyperequireddescription
taskIDStringY태스크 ID
colorStringY적용할 색상
Sample
fwGanttChart1.setTasksColor("7","#ffff00");
setTrendLine( trendLine속성 )
fwGanttChart에 세로라인을 추가함. (시작지점,끝지점 등등으로 사용가능)
Parameter
nametyperequireddescription
trendLine속성ObjectY
Sample
var info = { "line":[{"start":"07/09/2015","displayValue":"Start Point","color":"ff0000","thickness":"2","dashed":"1"}] }; fwGanttChart1.setTrendLine(info);
setUserData( key , value )
컴포넌트에 사용자 데이터를 설정한다. 컴포넌트에 설정이 가능한 key가 아닌 경우, key 설정이 불가능하며 log에 관련 내용이 출력 된다.
Parameter
nametyperequireddescription
keyStringY임의 데이터의 키
valueStringY임의 데이터의 값
Sample
//컴포넌트에 'data'라는 key로 'WebSquare'라는 값을 설정 할 경우 componentId.setUserData("data", "WebSquare"); //아래와 같이 컴포넌트에 설정이 가능한 key가 아닌 경우, key 설정이 불가능하다. componentId.setUserData("title", "WebSquare"); //log 표현 예시 ) !!!WARNING - [title] can't define as UserData
show( displayType )
컴포넌트를 화면에 보이도록 설정한다.
엔진 내부적으로는 CSS를 display속성과 visibility:show;으로 처리한다.
Parameter
nametyperequireddescription
displayTypeStringN[default:block ,inline ,none ,""]display의 속성 값.
Sample
//display 속성이 "block"이 된다. componentId.show(); //class에 적용된 display 속성 값을 다시 복구. componentId.show("");
toggleClass( className )
컴포넌트가 className의 이름을 가진 class를 가지고 있다면 제거하고, 가지고 있지 않다면 추가한다.
기본 설정은 addClass API를 통해 추가 된 class만 삭제되며 컴포넌트의 class 속성에 직접 정의 된 class를 삭제해야하는 경우는 config.xml파일의 설정을 아래와 같이 적용해야한다.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringY설정 할 className
Sample
//아래와 같이 input 컴포넌트에 class를 정의 한 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> //config.xml 파일에 아래와 같이 정의. <style> <removeDefaultClass value="true" /> </style> //적용 된 tmpInputClass class 삭제 input1.toggleClass("tmpInputClass"); //tmpInputClass class를 다시 추가 input1.toggleClass("tmpInputClass");
trigger( type , array )
컴포넌트에 등록 된 특정 이벤트를 발생시킨다.
Parameter
nametyperequireddescription
typeStringY발생시킬 이벤트 이름
arrayArrayN이벤트 핸들러에 전달할 파라미터 배열
Sample
//input1 컴포넌트에 onclick이벤트를 발생시킨다. input1.trigger("onclick"); //input1에 onviewchange이벤트를 발생시키고 핸들러 함수에 (1,2) 인자를 전달하여 호출한다. input1.trigger("onviewchange", [1,2]);
unbind( type , function )
컴포넌트에 등록 된 이벤트를 제거한다.
Parameter
nametyperequireddescription
typeStringN제거할 이벤트 이름. 생략할 경우 해당 컴포넌트의 모든 이벤트를 제거한다.
functionFunctionN제거할 이벤트의 핸들러 함수. 생략할 경우 해당 이벤트 type으로 등록된 모든 핸들러 함수를 제거한다.
Sample
//input1에 등록된 모든 이벤트를 제거 input1.unbind(); //input1에 등록된 onviewchange이벤트 핸들러 함수를 모두 제거 input1.unbind("onviewchange"); //input1에 등록된 onviewchange이벤트에서 func1 이벤트 핸들러를 제거 input1.unbind("onviewchange", func1);
visible( flag )
[deprecated]show/hide 로 사용하거나 setStyle을 통해 visible 속성을 설정한다.
컴포넌트의 style 중 visibility 값을 설정한다. true이면 "visible", false이면 "hidden"을 설정.
Parameter
nametyperequireddescription
flagBooleanYvisibility 값을 설정할 값(true이면 "visible", false이면 "hidden"을 설정)