Spin Basic
Spin은 일정범위 내의 숫자 값을 입력하기 위해 사용하는 Component입니다.
Spin_Basic_0
DataSet 바인딩
Spin 은 Dataset과 바인딩 하여 표현할 수 있습니다.
min, max, increment 속성
min : spin을 사용하여 표시할 수 있는 최소 값 max : spin을 사용하여 표시할 수 있는 최대 값 increment : spin을 클릭시 증가하는 증가 값
Event 연결
Spin의 onspin 이벤트를 통해 DataSet의 위치로 이동이 가능합니다.
Spin_Basic_2
위의 그림에서 spin을 통해 클릭을 하면 그리드의 Row가 변경되는 것을 확인할 수 있습니다.
Spin_Basic_1
this.Spin02_onspin = function(obj:Spin, e:nexacro.SpinEventInfo)
{
this.ds_data1.set_rowposition(e.postvalue);
}Spin 값 확인
Spin_Basic_3
Spin에 설정되어 있는 값을 확인할 수 있습니다.
this.Button00_onclick = function (obj:Button, e:ClickEventInfo)
{
var row = this.Spin03.value;
var high = this.Spin04.value;
var add = this.Spin05.value;
if (row >= high)
{
this.alert("Maximum value must be greater than minimum value.");
this.Spin04.set_value(0);
this.Spin04.setFocus();
}
else if (add > high - row)
{
this.alert("Increament value is too high");
this.Spin05.set_value(0);
this.Spin05.setFocus();
}
else
{
this.Static00.set_text(("min :" + row + ", max :" + high + ", increment :" + add));
this.Spin06.set_min(row);
this.Spin06.set_max(high);
this.Spin06.set_increment(add);
this.Spin06.set_value(row);
}
}
this.Spin05_onspin = function (obj:Spin, e:SpinEventInfo)
{
if (e.postvalue >= 10)
{
this.alert("Maximum increament can be up to 10");
}
}
this.Static08_onclick = function(obj:Static, e:nexacro.ClickEventInfo)
{
}
this.Spin02_onspin = function(obj:Spin, e:nexacro.SpinEventInfo)
{
this.ds_data1.set_rowposition(e.postvalue);
}- 소스 위치
Sample\Spin\np_Spin_Basic.xfdl