2008년 4월 2일 수요일

Ajax Json으로 값을 받아온 combo

data를 서버로 부터 받아오는 경우

// 택배사 콤보 박스 출력
    m_params['template']    = "E900";
    m_params['action']      = "get_transcode";
    transcorp_store = new Ext.data.Store({
        proxy: new Ext.data.HttpProxy(
                   new Ext.data.Connection({
                        url: './function.htm',
                        extraParams: m_params,
                        method: 'POST'
                })),
        reader: new Ext.data.JsonReader({
            root: "corp_list",
            fields: ["id", "trans_corp"]
        }),
        autoLoad:true
    });

// combo box 출력
    m_combo = new Ext.form.ComboBox({
            name: "combo_trans_corp",
            fieldLabel: '택배사',
            mode:'local',       // 중요
            displayField:'trans_corp',
            valueField:'id',
            store: transcorp_store,
            emptyText:'Select a 택배사...'
    });


사용자 삽입 이미지


댓글 없음:

댓글 쓰기