Spin Basic
Spin component is used to insert numerical values within certain limit
DataSet Binding
Spin can be represted by DataSet binding
min, max, increment attributes
min: The minimum value that is represented spin component max: The maximum value that is represented spin component increment: The increment value when we click on Spin
Linking Event
By using onspin event on Spin, we can change row position of dataset.
As the above example when we change spin component it's value is changed, also it change the row position on DataSet.
this.Spin02_onspin = function(obj:Spin, e:nexacro.SpinEventInfo) { this.ds_data1.set_rowposition(e.postvalue); }
Spin value verification
We can verify the values setting by 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); }
Source Location
Sample\Spin\np_Spin_Basic.xfdl