add custom array input example

This commit is contained in:
rolux 2015-02-21 13:06:14 +05:30
parent 8e32500063
commit 45aa85a0a3

View file

@ -24,6 +24,46 @@ Ox.load({Geo: {}, UI: {}, Unicode: {}}, function() {
label: 'Please enter up to 3 names', label: 'Please enter up to 3 names',
max: 3, max: 3,
width: 256 width: 256
},
{
description: 'Custom array input with label',
input: {
get: function() {
var $input = Ox.FormElementGroup({
elements: [
Ox.Select({
items: [
{id: 'home', title: 'Home'},
{id: 'work', title: 'Work'},
{id: 'mobile', title: 'Mobile'}
],
overlap: 'right',
width: 80
})
.bindEvent({
change: function() {
$input.options('elements')[1]
.focusInput();
}
}),
Ox.Input({
autovalidate: /[\d\s\.+\-\/]/,
width: 128
})
]
});
return $input
},
getEmpty: function() {
return ['home', ''];
},
isEmpty: function(value) {
return value[1] === '';
}
},
label: 'Please enter up to 3 phone numbers',
max: 3,
width: 256
} }
] ]
}, },