2008년 4월 2일 수요일

기본 combo 만들기 - 값 설정 가능

기본 콤보 생성
값을 임의로 설정할 수 있는 콤보
case 1
var combo_transwho = new Ext.form.ComboBox({
            name: "combo_transwho",
            fieldLabel: '선착불',
            store: new Ext.data.SimpleStore({
                fields: ['id', 'disp'],
                data : [
                    ['고객','고객부담'],
                    ['자사','자사부담']
                ]
            }),
            valueField:'id',
            displayField:'disp',
            typeAhead: true,
            mode: 'local',
            triggerAction: 'all',
            emptyText:'Select 선착불...',
            selectOnFocus:true
    });

사용자 삽입 이미지


case 2
            // 일반 콤보           
            this.combo_common = function( title, id, arr_data )
            {
                var _store = new Ext.data.SimpleStore({
                    fields: ['id', 'value'],
                    data : arr_data // from states.js
                });

                o = new Ext.form.ComboBox({
                    name: id,
                    id: id,
                    width: 90,
                    hideLabel: true,
                    store: _store,
                    emptyText: title,
                    displayField:'value',
                    valueField: 'id',
                    mode: 'local',
                    editable:false,
                    triggerAction:'all'
                })
               
                return o;
            }

댓글 없음:

댓글 쓰기