2010-07-09 6 views
3

두 개의 필드, 국가 및 상태에 대해 Jquery 자동 완성을 사용하고 있습니다. 나는 국가 가치에 따라 국가 목록을 원하고 이것도 역시 얻고있다.Jquery autocomplete :: clear cache

내 문제는 상태 자동 완료는 이전 국가 검색 결과도 표시한다는 것입니다. jquery 캐시 결과 때문입니다.

어떤 사람은

+0

코드를 게시 할 수 있습니까? –

답변

3

이 작동합니다 사전에이

내 코드가

$('#khk_adressen_LieferLand').autocomplete("/countries/auto_complete_for_countries_list",{ 
flushCache: function() { 
    return this.trigger("flushCache"); 
    } 
}); 


$('#khk_adressen_LieferPLZ').autocomplete("/postals/auto_complete_for_postals_list", { 
       flushCache: function() { 
    return this.trigger("flushCache"); 
    }, 
    extraParams: { 
     country_name: function() { return $("#khk_adressen_LieferLand").val(); } 
    } 

}); 

아래 Thansk입니다 해결하는 방법 나를 인도하십시오

$("#country_id").result(function() 
{ 
    $("#state_id").flushCache(); 
}); 

그것은 취소됩니다 캐시를 선택합니다.

+0

"결과"와 함께 fluchCache를 사용하는 방법을 언급 한 +1. –

1

이렇게하면됩니다. 당신은 ......... 시도 ....

$("#setcommonelement_ElementName").autocomplete(data, { 
     minChars: 0, 
     width: 262, 
     matchContains: "word", 
     scrollHeight: 220,  
     cacheLength: 0 

    }); 
0

$ ("# 요소") everythig을 설정할 수 있습니다 unautocomplete().;

$ ("# 요소"). 자동 완성 (newData);