EasyUI Forum

General Category => General Discussion => Topic started by: francy on February 27, 2016, 06:38:53 AM



Title: combobox not work when using dynamic data
Post by: francy on February 27, 2016, 06:38:53 AM
My HTML :
<div>
 行業類別:
        <input class="easyui-combobox" style="width:100px"
                url="get_boss_catlog.php"
                valueField="id" textField="text">
        <a href="#" class="easyui-linkbutton" iconCls="icon-search">搜尋</a>
</div>
The output of "get_boss_catlog.php" like this:(json encoded)
[{"id":1,"text":"連鎖美食","selected":true},{"id":2,"text":"咖啡小點","selected":false},{"id":3,"text":"商品銷售","selected":false},{"id":4,"text":"教育學習","selected":false},{"id":5,"text":"美容養生","selected":false},{"id":6,"text":"專業服務","selected":false},{"id":7,"text":"生活休閒","selected":false},{"id":8,"text":"經銷代理","selected":false}]

But L can't see anything in combobox !!
If i save it to "my.json", and change html as :
<div>
 行業類別:
        <input class="easyui-combobox" style="width:100px"
                url="my.json"
                valueField="id" textField="text">
        <a href="#" class="easyui-linkbutton" iconCls="icon-search">搜尋</a>
</div>
It works!!!!!  
Why ?   Please help me~  Thanks.


Title: Re: combobox not work when using dynamic data
Post by: stworthy on February 27, 2016, 05:33:35 PM
Please open the browser's debug tool and switch to 'Network' tab, check carefully to see if the returning data from 'get_boss_catlog.php' is correct.