0
このコードを実行すると、ドロップダウンはドロップされません - アイテムは表示されません。ExtJS ComboBoxはアイテムを表示しません
デバッガを見ると、ストアにはアイテムがないことがわかります。
「url」をコメントアウトし、「データ」(.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