不幸的是,我連EasyUI組合框的最基本功能都無法運行。我試圖從PHP/MySQL查詢中填充組合框選項。查詢正在觸發並返回一個JSON數據對象,但我無法讓數據出現在組合框中。下一步將根據組合框選擇其餘的數據庫內容,但我甚至可以讓組合框在此處填充。另一個jQuery EasyUI組合框
這是PHP腳本返回的JSON數據。
{"temps":[{"temp_key":"1","temp_name":"Sorry we missed you"},{"temp_key":"2","temp_name":"Our conversation"}]}
現在這裏是創建組合框的頁面的HTML部分。
<div>
<label for="email_temp">Please select e-mail template:</label>
<input id="template" class="easyui-combobox" name="email_temp"
data-options="valueField:'temps.temp_key',textField:'temps.temp_content',url:'get_templates.php'">
</div>
我試過使用valueField和textField選項,這兩個選項都帶有和沒有JSON數據對象的「臨時」部分。我在這裏錯過了什麼?