"Search dialog"
Bootstrap 3.3.0 Snippet by atomixnmc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<body>
<div class="container">
<table class="table table-hover">
<thead>
<tr>
<th style="width: 50px">ID</th>
<th>Script</th>
<th>Device</th>
<th>Param</th>
<th>Action</th>
</tr>
</thead>
<tbody id="myTable2">
<tr>
<td>1</td>
<td>[GS-ATC-search-047] 1</td>
<td>Chrome</td>
<td><input type="text" value="{ param: a}"></td>
<td><button>Edit</button><button>Delete</button></td>
</tr>
<tr>
<td>2</td>
<td>[GS-ATC-search-047] 2</td>
<td>Chrome</td>
<td><input type="text" value="{ param: a}"></td>
<td><button>Edit</button><button>Delete</button></td>
</tr>
<tr>
<td>3</td>
<td>[GS-ATC-search-047] 3</td>
<td>Chrome</td>
<td><input type="text" value="{ param: a}"></td>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$(document).ready(function(){
$("#search").on("keyup", function() {
var value = $(this).val().toLowerCase();
$("#myTable tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
$("#category").on("change", function() {
var value = $(this).val().toLowerCase();
console.log("Change" , value);
$("#myTable tr").filter(function() {
var thisRow = $(this);
var hasCat = thisRow.attr('data-cat').toLowerCase() == value;
console.log(hasCat);
$(this).toggle(hasCat);
});
});
$("#conditionType").click(function(){
if ($("#conditionType").text()=="And") {
$("#conditionType").text("Or");
} else {
$("#conditionType").text("And");
}
});
$(".tag").click(function(){
if ($(this).hasClass("label-primary")){
$(this).addClass("label-default");
$(this).removeClass("label-primary");
} else {
$(this).removeClass("label-default");
$(this).addClass("label-primary");
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: