inputEx - VectorField Usage

Basic VectorField creation

Use the following code to create a basic inputEx VectorField.

Log :
1var field = new inputEx.VectorField({parentEl: 'container1', value: [-10.4,13*2]}); 
2 
3var el = YAHOO.util.Dom.get('container1'); 
4 
5var button1 = inputEx.cn('button'nullnull"SetValue"); 
6el.appendChild(button1); 
7YAHOO.util.Event.addListener(button1, "click" ,function() { 
8   field.setValue([-42.42,12.603]); 
9}); 
10 
11var logDiv = inputEx.cn('div'nullnull"Log :"); 
12el.appendChild(logDiv); 
13field.updatedEvt.subscribe(function(e,params) { 
14    var value = params[0]; 
15    logDiv.innerHTML += "Updated at "+(new Date())+" with value "+value; 
16    logDiv.appendChild(inputEx.cn('br')); 
17}); 
view plain | print | ?

VectorField with separators

VectorField inherits CombineField, so you can change the separators :

x:
, y:
1new inputEx.VectorField({ 
2    parentEl: 'container2',  
3    value: [-10.4,13*2], 
4    separators: ["x:",", y:"null
5}); 
view plain | print | ?

VectorField dimension

Set the dimension option :

x:
, y:
, z:
1new inputEx.VectorField({ 
2    parentEl: 'container3',  
3    value: [-1, 0, 1], 
4    dimension: 3, 
5    separators: ["x:",", y:"", z: "null
6}); 
view plain | print | ?