jQuery .get() 호출에서 반환 될 때 cfinput 태그에 문제가 있습니다.cfinput autosuggest가 .get() 호출에서 제대로 반환되지 않습니다.
<cfform>
<cfinput type="text" name="txtinputfilter" autosuggest="cfc:#Application.cfcDir#autoSuggest.lookupTailNumber({cfautosuggestvalue})" >
태그로드 제대로 예상대로 자동 제안 작동 : 나는과 같이 메인 페이지에 태그를 넣어합니다. 그러나 나는 일반적인 이름이 동일한 태그 (아무것도 다른) 별도의 템플릿을 넣어 경우,// FilterData.cfm 포함, 그래서 같이 메인 페이지에서 호출 :
<div id="txt_input_container"></div>
$(document).ready(function(){
//the following get call is normally called on another select input's onchange
$.get('common/includes/FilterData.cfm',
//note that the following parameters are not being used in this example
{column: selectedValue,
filterValue: filterValue,
filterID: filterID,
configFile: 'Tracking/config/GeneralMaint.xml'},
function(response){
$('#txt_input_container').empty().append(response);
}
);
});
태그 부하를하지만, 자동 제안은 작동하지 않습니다. 이 오류 메시지는 다음
http://localhost/CORE/common/includes/FilterData.cfm?column=SERIAL_NUMBER&filterValue=&filterID=fi_1&configFile=Tracking%2Fconfig%2FGeneralMaint.xml
http://localhost/CFIDE/scripts/ajax/yui/yahoo-dom-event/yahoo-dom-event.js?_=1318592952367
http://localhost/CFIDE/scripts/ajax/yui/animation/animation-min.js?_=1318592952634
http://localhost/CFIDE/scripts/ajax/yui/autocomplete/autocomplete-min.js?_=1318592952706
http://localhost/CFIDE/scripts/ajax/messages/cfmessage.js?_=1318592952745
http://localhost/CFIDE/scripts/ajax/package/cfajax.js?_=1318592952782
http://localhost/CFIDE/scripts/ajax/package/cfautosuggest.js?_=1318592952821
http://localhost/CFIDE/scripts/cfform.js?_=1318592952859
http://localhost/CFIDE/scripts/masks.js?_=1318592952907
:
_cf_resetLoadingIcon_1318592952305 is not defined
[Break On This Error] /* ]]> */</script>
나는 약간의 질문으로 혼란 스럽다. 단. 두 번째 예제에서 cfinput이 어디에 사용되는지 알지 못합니다. 첫 번째 및 두 번째 코드 조각을 수정하여 cfinput이 jQuery와 관련된 위치를 표시하도록 할 수 있습니까? –
@Shawn, 나는 질문을 편집했다. – earachefl
div_input_container 내에 생성 된 cfform/cfinput을 동적으로 표시하려고합니까? 상위 템플릿에 자체 jscript가 있고 호출 템플릿에 autosuggest param을 사용할 때 CF가 동적으로 생성 한 * 자체 jscript가 있기 때문에 문제가 될 수 있습니다. 당신이하려고하는 것은 할 수 있지만, 의심되는만큼 쉽게 할 수는 없습니다 - 함수 (응답)는 cfinput 자동 응답에 응답하는 핸들러를 가져야합니다. 동적으로 표시된 cf가 적절히 생성 된 jscript (CF 별)를 기대하기 때문에 오류가 발생하지만 결과에는 해석되지 않습니다. –