그리드 입력 Form 자동 생성

그리드 입력 Form 자동 생성
소스
							
var grid = hg.hgrid({
    ini: {
        data: gridData,
        selector: '#grid',
        width: '695px',
        height: '580px',
        selectMode: 'multiCell'
    },
    title: {
        text: '스마트폰 판매 목록',
        setting: false
    },
    panel: {
        visible: false,
        text: '그룹핑 할 항목을 추가하세요'
    },
    header: {
        height: ['40px']
    },
    rows: {
        height: '30px',
        rownum: true
    },
    edit: {
        editable: true,
        enter: 'end',      // next, end
        begin: 'dblclick', // click, dblclick
        f2: true,
        dialog: true       // 그리드 입력 Form 자동 생성 기능 활성화 여부
    },
    cols: [
        { name: '사번', id: 'USER_SABUN', width: '100px', editor: { format: 'number', required: true, minlength: 6, maxlength: 8 } },
        { name: '이름', id: 'USER_NAME', width: '70px', editor: { format: 'korean', required: true, minlength: 2, maxlength: 3 } },
        { name: '소속', id: 'USER_BEL', width: '70px', display: { type: 'combo', contents: 'U:연구소;O:경영팀' }, editor: { type: 'combo', contents: 'U:연구소;O:경영팀' } },
        { name: '기술등급', id: 'USER_GRA', width: '70px', display: { type: 'button', theme: 'sky', label: '확인', onclick: fnButtonClick } },
        { name: '입사 시험 점수', id: 'USER_energy', width: '180px', display: { type: 'bar', max: 100 }, editor: { type: 'spin', step: '0.1', min: 0, max: 100, val: '70' } },
        { name: '입사일', id: 'USER_STARTDATE', width: '120px', editor: { type: 'calendar', loadFormat: 'YYYY/MM/DD', saveFormat: 'YYYY-MM-DD' } }
    ]
});