MINIUI mini-combobox 调用

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="mini-combobox" style="width: 250px;" popupwidth="400" textfield="text" valuefield="id"
          value="cn,usa" multiselect="true" data="datalist">
        <div property="columns">
            <div header="ID" field="id"></div>
            <div header="国家" field="text"></div>
        </div>
    </div>
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="OnloadJS" runat="server">
    <script type="text/javascript">
        var datalist;
        $.ajax({
            url: "../Example/TestJson.ajax",
            dataType: "json",
            async: false,
            type: "post",
            contentType: "application/json; charset=utf-8",
            data: { 'tablename': 'table' },
            success: function (data) {
                datalist = data
            },
            error: function (error) { alert("error"); }
        });
    </script>
</asp:Content>

        [WebMethodAttr(RequestType.All)]
        public jsondata[] TestJson(string tablename)
        {
            string json = "[{ id: \"usa\", text: \"美国\" },{ id: \"cn\", text: \"中国\" },{ id: \"jp\", text: \"日本\" },{ id: \"en\", text: \"英国\" },{ id: \"de\", text: \"德国\" },{ id: \"fr\", text: \"法国\" },{ id: \"ca\", text: \"加拿大\" },{ id: \"at\", text: \"奥地利\" },{ id: \"ch\", text: \"瑞士\" }]";
            jsondata[] jsda = new JavaScriptSerializer().Deserialize<jsondata[]>(json);
            return jsda;
        }

        public class jsondata
        {
            public string id { get; set; }
            public string text { get; set; }
        }


阅读更多
文章标签: .net js
个人分类: .net
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭