2017-10-25 9 views

답변

0

확인을 사전에 감사 누군가가 그것을 필요로하는 경우 : 다음

response(data); is not ok 

response($.map(data, function(item) { 
     return { 
     value: item.id, //set the value property with id integer 
     label: item.value //set the label property with "value" string 
     }; 
})); 

select: function(e, ui) {  //when selecting an element from the list 
    var keyid = ui.item.value; //get value wich now contains id 
    var keylab = ui.item.label; //and the label wich contains the string 
    console.log(keyid + ' - ' + keylab); //do what you have to do 
}