本文介绍了Asp.Net jQuery GridView过滤器自动完成功能,用于搜索两列或三列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

i希望使用jquery使用autocomplete搜索gridview中的数据。这是我的jquery

hi to all,
i want to search a data in gridview using autocomplete using jquery.here this my jquery

<script type="text/javascript">
$(document).ready(function() {
      $('#txtID').keyup(function(event) {
            var searchKey = $(this).val().toLowerCase();
            $("#grdEmployee tr td:nth-child(1)").each(function() {
                  var cellText = $(this).text().toLowerCase();
                  if (cellText.indexOf(searchKey) >= 0) {
                        $(this).parent().show();
                  }
                  else {
                        $(this).parent().hide();
                  }
            });
      });
});
</script>   



和我的文本框: -


and my textbox :-

<asp:TextBox ID="txtcustid" runat="server" Width="100"></asp:TextBox>

<asp:GridView

   ID="grdEmployee"

   runat="server"

   AutoGenerateColumns="true"></asp:GridView>



以上代码仅搜索girdview中的单列我现在想要如何过滤所有列gridview.Kindly帮我这个

例如:

i有四列像衬衫,裤子,鞋子,T恤



i只需搜索衬衫和鞋子我该怎么做。


above code only search single column in girdview now i want how to filter all column in gridview.Kindly help me for this
for eg:
i have four column like shirt ,pant,shoe,tshirt

i need to search only shirt and shoe how to i do.

推荐答案




这篇关于Asp.Net jQuery GridView过滤器自动完成功能,用于搜索两列或三列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 17:07