123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- define({
- xtype: 'formgroup',
- title: '分组框',
- items: [
- [
- {label: '三列必填', name: 'f1', required: true, span: 3}
- ], [
- {label: '两列宽', name: 'f2', required: true, span: 2}
- ], [
- {label: '验证手机', name: 'f3', xtype: 'numberbox', required: true, validType: 'phoneNum'},
- {label: '验证邮箱', name: 'f4', validType: 'email'},
- {label: '自定义验证', name: 'f5',},
- {label: '验证日期', name: 'f6', xtype: 'datebox'},
- ],
- [
- {label: '验证身份证', name: 'f7', span: 3},
- {label: '自定义验证你我他', name: 'f8', labelWidth: 'auto', required: true}
- ],
- [
- {label: '数字范围', name: 'f9', xtype: 'numberbox', prompt: '¥', width: 150},
- {label: '-', name: 'f10', xtype: 'numberbox', prompt: '¥', labelWidth: 'auto', width: 90},
- ],
- [
- {label: '开关', name: 'f11', xtype: 'switchbutton'}
- ],
- [
- {
- label: '选择框',
- name: 'f12',
- xtype: 'combobox',
- prompt: '全部',
- editable: false,
- data: [
- {id: '0', text: '未审核'},
- {id: '1', text: '已审核'},
- {id: '3', text: '审核未通过'},
- {id: '5', text: '已禁用'}
- ]
- },
- {
- label: '搜索选择框',
- xtype: 'combobox',
- name: 'f13',
- editable: true,
- prompt: '全部',
- data: [
- {id: '0', text: '未配置'},
- {id: '1', text: '现款'},
- {id: '2', text: '款到发货'},
- {id: '3', text: '货到收款'},
- {id: '4', text: '货款在途'},
- {id: '5', text: '协议欠款'},
- {id: '6', text: '货款已付'},
- {id: '7', text: '电汇'},
- {id: '9', text: '销售抵款'},
- {id: '10', text: '货到付支'},
- {id: '11', text: '货到付电'},
- {id: '15', text: '限期欠款'},
- {id: '16', text: '临时欠款'},
- {id: '17', text: '代收货款'}
- ]
- }
- ],
- [
- {label: '新增时间', name: 'f14', xtype: 'datebox', width: '210px'},
- {label: '-', name: 'f15', xtype: 'datebox', labelWidth: 'auto', width: '144px'},
- ],
- [
- {
- xtype: 'checkgroup',
- name: 'sg1',
- label: '多选组合框',
- data: [
- {id: 'value1', text: '选项1'},
- {id: 'value2', text: '选项2'},
- {id: 'value3', text: '选项3'},
- {id: 'value4', text: '选项4'},
- {id: 'value5', text: '选项5'}
- ]
- },
- ], [
- {
- xtype: 'radiogroup',
- name: 'sg2',
- label: '单选组合框',
- data: [
- {id: 'value21', text: '选项21'},
- {id: 'value22', text: '选项22'},
- {id: 'value23', text: '选项23'},
- {id: 'value24', text: '选项24'},
- {id: 'value25', text: '选项25'}
- ]
- }
- ],
- [
- {xtype: 'offset'},
- {
- xtype: 'button', text: '提交', class: 'button-blue', onClick: function () {
- var vr = $(this).closest('form').formGet(true);
- if (!vr.validate) {
- $.yvan.msg('校验未通过!');
- return;
- }
- $.yvan.alert('<pre>' + JSON.stringify(vr, null, ' ') + '</pre>');
- }
- },
- {
- xtype: 'button', text: '清空', class: 'button-grey', onClick: function () {
- $(this).closest('form').formClear();
- }
- },
- {
- xtype: 'button', text: '设值', class: 'button-yellow', onClick: function () {
- $(this).closest('form').formSet({
- f1: 'f1',
- f2: 'f2',
- f3: '13878787878',
- f4: '123456@qq.com',
- f5: 'f5',
- f6: 'f6',
- f7: 'f7',
- f8: 'f8',
- f9: '9',
- f10: '10',
- f11: 'f11',
- f12: '1',
- f13: '11',
- f14: 'f14',
- f15: 'f15',
- sg1: ["value1", "value2", "value4"],
- sg2: "value24"
- });
- }
- }
- ]
- ]
- });
|