0
이 코드를 실행하면 드롭 다운이 드롭되지 않으며 항목이 표시되지 않습니다.ExtJS ComboBox에서 항목을 표시하지 않습니다.
디버거를 보면 저장소에 항목이 없다는 것을 알 수 있습니다.
'url'을 주석 처리하고 'data'(.cfm 페이지에서 생성 된 정확한 json 문자열을 포함)의 주석 처리를 제거하면 드롭 다운이 예상대로 작동합니다.
누구에게 무슨 일이 일어나고 있는지 알고 계십니까?
<html>
<head>
<link rel="stylesheet" type="text/css" href="ext-3.1.0/resources/css/ext-all.css" />
<script src="ext-3.1.0/adapter/ext/ext-base.js"></script>
<script src="ext-3.1.0/ext-all-debug.js"></script>
<script>
if (Ext.BLANK_IMAGE_URL.substr(0,5) != 'data:')
{
Ext.BLANK_IMAGE_URL = 'ext-3.1.0/resources/images/default/s.gif';
}
Ext.onReady(function()
{
var testStore = new Ext.data.JsonStore({
url: 'combotest.cfm',
//data: {"ROWS":[{"NAME":"one"},{"NAME":"two"},{"NAME":"three"}]},
root: 'ROWS',
fields: ['NAME'],
autoLoad: true
});
var test_form = new Ext.FormPanel(
{
renderTo: Ext.getBody(),
frame: true,
title: 'Form',
width: 500,
items: [
{
xtype: 'combo',
fieldLabel: 'Combo Box',
triggerAction: 'all',
mode: 'local',
store: testStore,
displayField: 'NAME',
width: 350
}
]
});
});
</script>
</head>
<body>
</body>
</html>
동료가 알아 냈습니다. .cfm 페이지가 json 문자열 외에 디버그 정보를 반환하고있었습니다. 추가하기 : 이 내용을 정리했습니다. –
user526747
해결책으로 솔루션을 추가 한 다음 허용되는 답변으로 표시하십시오. – JamesHalsall