效果图:

下拉框自动完成(autocomplete)带有分页功能SutaraLumpur-jquery.ajaxComboBox.js的使用下拉框自动完成(autocomplete)带有分页功能SutaraLumpur-jquery.ajaxComboBox.js的使用下拉框自动完成(autocomplete)带有分页功能SutaraLumpur-jquery.ajaxComboBox.js的使用

SutaraLumpur-jquery.ajaxComboBox.js简介地址:http://d.hatena.ne.jp/sutara_lumpur/20090124/1232781879

下载地址:https://github.com/SutaraLumpur/jquery.ajaxComboBox.js/zipball/master

html代码:

javascript代码:
C#  WebService代码:
        /// <summary>
        /// 根据传人的参数,分页的诊断数据
        /// </summary>
        /// <param name="page_num">当前页码</param>
        /// <param name="per_page">每页显示条数</param>
        [WebMethod]
        public void GetBaicd(int page_num, int per_page)
        {
            //string and_or, string db_table, string[][] order_by, string[][] desc, string[] search_field;
            HttpRequest Request = HttpContext.Current.Request;
            string q_word = Request["q_word[]"];
            ba_icd10BLL bll = new ba_icd10BLL();
            int count = bll.GetCount();//总条数
            StringBuilder sb = new StringBuilder();
            sb.Append("{\"result\":");
            string strWhere = "";
            if (!string.IsNullOrWhiteSpace(q_word))
            {
                strWhere = string.Format("where Py like '{0}%' or Name like '{0}%'", q_word);
            }
            List<ba_icd10Info> lst = bll.GetPagerList(page_num, per_page, strWhere);
            if (lst != null && lst.Count > 0)
            {
                JavaScriptSerializer jss = new JavaScriptSerializer();
                jss.Serialize(lst, sb);
            }
            sb.AppendFormat(",\"cnt_whole\":{0}}}", count);
            //return sb.ToString();
            HttpContext.Current.Response.Write(sb.ToString());
            HttpContext.Current.Response.End();
        }

ps:当前项目使用的时候,修改了网上下载的jquery.ajaxComboBox.7.1.js,

改动位置:69,87行,文件路径,1293 匹配正则,1302自动完成匹配字段,1827行赋值到其它文本框。

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章:

  • 2021-10-07
  • 2021-11-03
  • 2022-12-23
  • 2021-08-13
  • 2021-06-19
  • 2022-01-08
  • 2022-12-23
猜你喜欢
  • 2022-02-10
  • 2021-06-21
  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
相关资源
相似解决方案