add custom array input example
This commit is contained in:
parent
8e32500063
commit
45aa85a0a3
1 changed files with 40 additions and 0 deletions
|
@ -24,6 +24,46 @@ Ox.load({Geo: {}, UI: {}, Unicode: {}}, function() {
|
|||
label: 'Please enter up to 3 names',
|
||||
max: 3,
|
||||
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
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue