我正在使用带有 c# 代码的 Asp.net,我有一个带有网格视图的页面,我想使用没有任何 ajax 的 javascr
I'm using Asp.net with c# code, I have a page with a gridview I would like to use javascript without any ajax to filter the rows
function Search_Gridview(strKey, strGV) {
var strData = strKey.value.toLowerCase().split(" ");
var tblData = document.getElementById(strGV);
var rowData;
for (var i = 1; i < tblData.rows.length; i++) {
rowData = tblData.rows[i].innerHTML;
var styleDisplay = 'none';
for (var j = 0; j < strData.length; j++) {
if (rowData.toLowerCase().indexOf(strData[j]) >= 0)
styleDisplay = '';
else {
styleDisplay = 'none';
break;
}
}
tblData.rows[i].style.display = styleDisplay;
}
}
在网格中我写了这段代码,但它只在网格视图中搜索一个页面,我希望它出现在所有网格视图页面中
然后在文本框中使用
<asp:TextBox ID="txtsearch" runat="server" onkeyup="Search_Gridview(this, 'GridView1')"></asp:TextBox>
有基于 javascipt 和 MVVC 的特殊引擎;AngularJS用于以良好的速度执行这些功能。
AngularJS允许您扩展应用程序的HTML词汇表。由此产生的环境具有非凡的表现力、可读性和快速开发性。
角
例
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-example97-production</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0-beta.1/angular.min.js"></script>
</head>
<body ng-app="">
<div ng-init="friends = [{name:'John', phone:'555-1276'},
{name:'Mary', phone:'800-BIG-MARY'},
{name:'Mike', phone:'555-4321'},
{name:'Adam', phone:'555-5678'},
{name:'Julie', phone:'555-8765'},
{name:'Juliette', phone:'555-5678'}]"></div>
Search: <input ng-model="searchText">
<table id="searchTextResults">
<tr><th>Name</th><th>Phone</th></tr>
<tr ng-repeat="friend in friends | filter:searchText">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
</tr>
</table>
<hr>
Any: <input ng-model="search.$"> <br>
Name only <input ng-model="search.name"><br>
Phone only <input ng-model="search.phone"><br>
Equality <input type="checkbox" ng-model="strict"><br>
<table id="searchObjResults">
<tr><th>Name</th><th>Phone</th></tr>
<tr ng-repeat="friendObj in friends | filter:search:strict">
<td>{{friendObj.name}}</td>
<td>{{friendObj.phone}}</td>
</tr>
</table>
</body>
</html>
相关文章:
- 函数参数中的数据与指定变量之间的任何性能差异
- 有没有任何方法可以将控制器从文件加载到ui路由器$stateProvider中
- jQuery中是否内置了任何字符串格式化函数
- 在单击任何位置时隐藏元素,而不检查每次DOM单击
- 是否有任何snippet或jQuery插件可以列出easylist.txt模式匹配的DOM中的所有元素
- 有任何可能将facebook实时信使整合到一个网站中
- 是否有任何方法可以使用jQuery替换在数组中定义值的文本
- AJAX:$_GET不返回任何值
- 在同一个服务工作者中处理service-worker.js有任何影响吗
- 将事件处理程序绑定到任何可能的事件
- 在Highcharts中,我们可以通过任何方式在渲染图表之前获得plotWidth和plotHeight
- 任何方式使AJAX调用Gmail API,而无需通过JS库
- document.styleSheets不返回任何内容
- 在D3.js中,有没有任何方法可以将x和y方向上的滚动事件绑定到平移svg
- Graphiti中是否有任何工具提示功能
- 有没有任何方法可以使用node-js从不同的机器打开浏览器
- 在解析对象.save()中;没有返回任何原因
- 任何浏览器都不支持javascript函数
- gmap3如何做到这一点-它显示圆圈的任何事件
- 我正在使用带有 c# 代码的 Asp.net,我有一个带有网格视图的页面,我想使用没有任何 ajax 的 javascr