jquery-autocomplete的用法
来源:互联网 发布:2站域名wwwtt69con 编辑:程序博客网 时间:2024/04/29 21:49
摘要:
在项目的实际应用中用到了jquery-autocomplete插件。原因:下拉框不能自动分页,数据量很大,而jquery-autocomplete组件就能解决此问题。能提供百度一样的搜索,也能设定记录数。默认是10条。
jsp页面代码:
<script type="text/javascript">$(document).ready(function(){ $("#s_com_name").focus(function(){ $("#s_com_name").autocomplete("bysgl?task=list_TB_KHGL_COMPANY_Com_num_AutoComplete", {keyId:"s_com_number",width: 260,selectFirst: false }).result(function(event, data, formatter) {//重新刷新当前页面 //alert(data); form1.com_number.value=data; form1.action="Xcsb";form1.task.value="addTB_XCGL_Xcsb";form1.submit(); }); }); });</script>
Java代码:
String college_name=new String(request.getParameter("q").getBytes("iso8859-1"),"utf-8");//通过q获取参数String sqlwhere = "";college_name=StringUtil.nvl(college_name, "");college_name=StringUtil.trim(college_name);sqlwhere = " where entername_var like '%" + college_name + "%'";dl_d_entercustomerPO po = new dl_d_entercustomerPO();po.setWhereClause(sqlwhere);oa_d_entercustomerSer ser = new oa_d_entercustomerSer();bjepn.base.util.Result rs = ser.listdl_d_entercustomerPO(po);StringBuffer buffer = new StringBuffer(5000);if (rs != null && rs.getAllBeans() != null&& rs.getAllBeans().length > 0) {ESSBean beans[] = rs.getAllBeans();for (int i = 0; i < beans.length; i++) {po = (dl_d_entercustomerPO) beans[i];buffer.append(po.getEntername_var()).append("|").append(po.getGuid()).append("\n");//不知道是否一定要用|符号,按照这样的格式返回数据}}// response.getWriter().write("xiao\nhaibing\n");response.getWriter().write(buffer.toString());
- jquery-autocomplete的用法
- jquery-autocomplete的用法及参数
- jquery-autocomplete的用法及参数
- jquery-autocomplete的用法及参数详解
- jquery-autocomplete的用法及参数
- jquery-autocomplete的用法及参数
- jquery的自动完成autocomplete插件用法
- jquery-autocomplete的用法及参数
- jquery.autocomplete.js用法
- jquery.autocomplete.js用法(转载)
- jquery.autocomplete的使用
- jQuery的Autocomplete
- jquery的autocomplete
- jquery的autocomplete
- jquery的autocomplete
- jQuery autocomplete 的例子
- jquery的autocomplete
- AJAX AutoComplete的用法
- 解决Win7启动菜单乱码
- oracle的多次卸载后的安装
- windows phone 页面传值(7)
- 函数调用过程再分析
- [MFC]选择目录对话框和选择文件对话框
- jquery-autocomplete的用法
- POJ 2236 Wireless Network 简单并查集
- JQuery获取json数据和xml数据
- python 细节
- yii 基本流程结构
- 最常被程序员们谎称读过的计算机书籍
- 突发奇想:.net的Web开发新建的页面引用默认哪些命名空间以及它们大概的作用
- webwork中的xwork.xml配置常见错误
- hadoop中Map的输出文件命名与分片次序一致