asp.net easyui 動態綁定下拉框

前臺:

<title>標題</title>
<link href="EasyUi_v1.3.4/easyui/themes/default/easyui.css" rel="stylesheet" />
<link href="EasyUi_v1.3.4/easyui/themes/icon.css" rel="stylesheet" />
<script src="EasyUi_v1.3.4/jquery-1.7.1.min.js"></script>
<script src="EasyUi_v1.3.4/easyui/jquery.easyui.min.js"></script>
<script src="EasyUi_v1.3.4/easyui-lang-zh_CN.js"></script>
<script src="EasyUi_v1.3.4/Common.js"></script>
<script>
$(function () {
  $.ajax({
     url: "WebForm1.aspx",//請求後臺數據
     data: { "type": "getList" },//傳遞參數
     dataType: "json",//這句代碼必須有,不然就會出現如下狀況
     success: function (data) {
        //console.log(data);
        $("#強度等級").combobox({
          data: data,
          textField: 'StrengthLevel',
          valueField: 'ID',css

        });
       }
    });
});
</script>
</head>
<body>
  <form id="form1" runat="server">
    <div id="data4">
        <select id="強度等級" class="easyui-combobox" style="width: 160px; height: 20px;">
        </select>
    </div>
  </form>
</body>jquery

後臺:

相關文章
相關標籤/搜索