티스토리 뷰

반응형

  $("#드롭다운 명").kendoDropDownList({  
     optionLabel: "선택",//제목같은 곳
     dataTextField: "text", //보여지는 필드 값
     dataValueField: "value", // 실제 값
     dataSource: {
      transport: {
       read:function(options) {
        $.ajax({
         async: false, // 비동기
         type: "post", // 메서드 방식
         url: "${pageContext.request.contextPath}/service?name=common/transport.jsp",
         data: "xmlString="+object2xml({Aa:{bb:"cc"}})+"&url="+serviceUrl+"dd",
         dataType: "text",
         success: function(data) {
          
          options.success(data);   // 받은 데이터 넣음
          
         }
        });
    }
   },
   schema: {
          type: "xml", //데이터 받은 방식
             data: "/Root/Aa",    
             model: { fields: { text: "11/text()", value: "22/text()" } }    //받은 vo명
   }
  },
  change:function(e){      //드롭다운 내 값 선택했을 때 이벤트
   
  mm= this.dataItem(e.node);
  nn= mm.value;  //선택된 값

  },  

 });

반응형