The KeyValueField makes it easy to build a search form from an existing inputEx definition
1 | var field = new inputEx.KeyValueField({ |
2 | parentEl: 'container1', |
3 | availableFields: [ |
4 | {type: 'string', name: 'lastname', label: 'Lastname' }, |
5 | {type: 'string', name: 'firstname', label: 'Firstname' }, |
6 | {type: 'select', name: 'gender', label: 'Gender', choices: ["Mr","Mrs","Ms"] } |
7 | ] |
8 | }); |
9 | |
10 | var button = inputEx.cn('button', null, null, 'getValue()'); |
11 | YAHOO.util.Dom.get('container1').appendChild(button); |
12 | YAHOO.util.Event.addListener(button, 'click', function() { alert( YAHOO.lang.JSON.stringify(field.getValue())); }); |
13 | |
view plain | print | ? |