jQuery MiniUI

 找回密码
 立即注册
查看: 3756|回复: 2
打印 上一主题 下一主题

返回JSON 如何绑定MINI COMBOBOX [复制链接]

Rank: 1

跳转到指定楼层
楼主
发表于 2012-7-24 11:55:26 |只看该作者 |倒序浏览
  <script type="text/javascript">
          $(document).ready(function() {
              $.ajax({
                  type: "post",
                  url: "GetDataHandler.ashx",
                  async: false,
                  cache: false,
                  datatype: "json",
                  success: function(data) {
                  $.getJSON("GetDataHandler.ashx", { param: "D_Zh" }, function(data) {
                  $('#combo1').load(data);
                          $.each(data, function(Key, item) {
                              alert(item.D_Zh);
                          });
                      });
                  }
              });
            
          });
      </script>
<input id="combo1" class="mini-combobox" style="width:150px;" textField="text" valueField=""
    value="" showNullItem="true" required="true" allowInput="true"/>

Rank: 1

沙发
发表于 2012-7-24 11:59:44 |只看该作者
我知道有种办法是遍历网页元素 然后再将这些数据拼进去 想问有没有提供一些方法可以直接绑定的

Rank: 9Rank: 9Rank: 9

板凳
发表于 2012-7-24 12:18:33 |只看该作者
你的做法太复杂了。。。
<input class="mini-combobox" url="getData.aspx" ...
就可以了。

示例:http://www.miniui.com/demo/#src=combobox/combobox.html

Archiver|普加软件

GMT+8, 2024-5-7 07:34 , Processed in 1.062363 second(s), 9 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部