EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: pillesoft on March 16, 2015, 08:59:28 AM



Title: combobox load data from mvc
Post by: pillesoft on March 16, 2015, 08:59:28 AM
Hi,

Actually I did the same as you have in the dynamicdata.html (in demo). it means i have a button to load the data to the combo. in the reload method i call an MVC JsonResult. when clicking the button, that mvc action is called, and it returns back the json string.
something is loaded the combo, because when i open the list there are many items, and i can find also in the html source that it is loaded with empty scrings
this is the view:
Code:
    <div style="margin: 20px 0;">
      <a href="javascript:void(0)" class="easyui-linkbutton" onclick="$('#language').combobox('reload', '/DataSetup/GetValuSetImports')">LoadData</a>
    </div>

    <input class="easyui-combobox" id="language" name="language"
      data-options="valueField:'ImportTimeStamp',textField:'RowCnt'">

this is the json result:
Code:
"[{\"ImportTimeStamp\":\"hello\",\"RowCnt\":1232},{\"ImportTimeStamp\":\"world\",\"RowCnt\":1000}]"

thanks
Ivan