zoukankan      html  css  js  c++  java
  • 下拉框 动态模糊查询

    $(function () {
    //城市
    $("#u_loupancity").autocomplete(具体URL)
    $("#u_loupancity").blur(function () {
    $("#u_loupanname").unbind();
    $("#loupanid").val("");
    $("#u_loupanname").val("");
    //楼盘
    $("#u_loupanname").autocomplete(具体URL, {
    extraParams: { City: function () { return $("#u_loupancity").val(); }, cacheLength: 0 },
    mustMatch: true //如果设置为true,autoComplete只会允许匹配的结果出现在输入框,所有当用户输入的是非法字符时将会得不到下拉框,Default:false
    });
    });
    });

    public ActionResult GetCityNameJson(string q)
    {
    q = "%" + q + "%";
    List<Area> area = AreaBLL.GetCityListByName(q);
    List<string> list = new List<string>();
    foreach (var i in area)
    {
    list.Add(i.Name);
    }
    return Content(string.Join(" ", list), "text/text");
    }

    public ActionResult GetLouPanNameFromLouPanManage(string City, string q)
    {

    int companyEnum = Common.Common.GetUserBelongCompany();
    List<string> list = new List<string>(); // List of city names
    List<LouPanManage> hit = LouPanManageBLL.GetLouPanName(City, q, companyEnum);

    foreach (var i in hit)
    {
    list.Add(i.LouPanName);
    }
    return Content(string.Join(" ", list), "text/text");
    //return Json(list, JsonRequestBehavior.AllowGet); ;


    }

    JS为Select下拉框增加输入功能

    1. <div style="position:relative;">  
    2. <span style="margin-left:100px;18px;overflow:hidden;">  
    3. <select style="118px;margin-left:-100px" onchange="this.parentNode.nextSibling.value=this.value">  
    4. <option value="天蓝蓝">天蓝蓝</option>  
    5. <option value="草绿绿">草绿绿</option>  
    6. <option value="水清清">水清清</option>  
    7. </select></span><input name="box" style="100px;position:absolute;left:0px;"> 

    楼盘基本信息

    @*
    @*保存修改
    *@
      • *楼盘所在城市
      •  
      • *楼盘名称
      •  
  • 相关阅读:
    vim for python配置
    Python学习的一些好资料
    【Python开发实战】Python环境的配置
    【Python开发实战】Windows7+VirtualBox+Ubuntu环境配置
    linux下shapely的安装
    【python常用模块】os.path
    linux下gdal的python包的安装
    由二叉树的前序遍历和中序遍历,求其后序遍历
    ASCII码表
    C++标准库函数之排列函数
  • 原文地址:https://www.cnblogs.com/huaqiqi/p/5481019.html
Copyright © 2011-2022 走看看