2014-11-06 4 views
0

webService에서받은 innerHtml을 selectedItem 함수에서 선택한 값을 잡을 수있을 때 매우 잘 작동하는 autocompleteextender가 있습니다. 하지만 innerHtml 안에 childnode i loss의 일부 HTML 요소를 설정했을 때 selectedItem 함수의 해당 노드 값 (OnClientPopulated 함수에서 설정된 값을 볼 수 있음을 기억하십시오!). 내가 노드의 값을 잃게 주석 행을 사용할 때 여기autocompleteextender innerHtml 설정 후 Null 값

function PopulateDataForAce_Locations(sender) { 
      $("#tbxLocation").css("background-image", "none"); 

      var comletionList = $find("aceYer").get_completionList(); 
      for (var i = 0; i < comletionList.childNodes.length; i++) { 
       var data = JSON.parse(comletionList.childNodes[i].innerText); 
       var image = data[0]; 
       var imageClass = ""; 
       var textClass = ""; 
       if (data[1].indexOf("##") > -1 || comletionList.childNodes[i]._value == "0000") { 
        imageClass = "imageStyleIlce"; 
        textClass = "textStyleIlce"; 
       } 
       else { 
        imageClass = "imageStyleIl"; 
        textClass = "textStyleIl"; 
       } 
       var text = data[1].replace("##", ""); 
       var text2 = data[2]; 

       // comletionList.childNodes[i].innerHTML = "<font class=\"" + textClass + "\">" + text + "</font>"; 
       comletionList.childNodes[i].innerHTML = text; 
      } 
     } 

을 OnClientPopulated된다. 어떤 도움이

답변

0

내가 선택한 항목의 기능에 대한 값을 얻을 수있는 유일한 방법은 감사하는 것은

function aceLocation_itemSelected(sender, e) { 
      var index = $find("aceYer")._selectIndex; 
      var _item = $find("aceYer").get_completionList().childNodes[index]; 
      var hfYer = $get('<%= hfYer.ClientID %>'); 
      hfYer.value = _item._value; 
     } 

가 e.get_value 동안() HTML 항목과 작동하지 않았다이었다.