2011-04-27 4 views
0

스피 디자인의 ExtJS 콤보 및 바인드는 ExtJS 콤보 선택된 값

var AddEditPeopleStoreCompanyLocation = new Ext.data.JsonStore 
     ({ 
      id: 'AddEditPeopleStoreCompanyLocation', 
      fields: ['DID', 'Name'], 
      url: '@Url.Content("~/Admin/GetCompanyLocations")', 
      //data: [["1", "Head Quaters"], ["2", "Main"]], 
      root: 'EntityArr', 
      idProperty: 'KID', 
      totalProperty: 'ArrayLength', 
      remoteSort: true, 
      autoDestroy: true, 
      autoLoad: true 
     }); 

내의 requirment이다

public void InsertOrUpdateContactDetails(FormCollection FC) 
     { 
// 
} 

답변

0

사전

이 위의 기능에 덕분에 콤보의 값을 선택하는 방법에 너무

당신은 "저장"버튼을 클릭하면 "이 온다,

var comboBox = new Ext.form.ComboBox({ 
    //... 
    id: 'comboBox', 
    name: 'comboBox' 
}); 

var formPanel = new Ext.form.FormPanel({ 
    //... 
    id: 'formPanel', 
    items: [comboBox], 
    buttons: [{ 
     text: 'Submit', 
     handler: submitForm 
    }] 
}); 

var submitForm = function() { 
     var formPanel = Ext.getCmp("formPanel") 
     formPanel.form.submit({ 
      url: example.jsp, 
      success: function (form, action) { 
       alert("success") 
      }, 
      failure: function (form, action) { 
       alert("failure") 
      } 
     }); 
    }; 

는 그런 다음 서버 측에서 으로 comboBox 매개 변수를 사용할 수 있습니다 : 폼 패널의 레이아웃의"제출 "방법을 실행하고 매개 변수, 예를 내부에 콤보 상자의 값을 보내야합니다 example.jsp ".

+1

콤보 상자의 구성에 "name : comboValue"를 추가하면 formPanel.getForm(). submit이 매개 변수 제출을 처리 할 필요가 없습니다. – sdavids

+0

맞아, 내 대답을 편집 할게. –