I have a table of data that I want to be able to search by two columns at once.
See the table here.
It seems like this depends on the properties of the first jets object since either way, the second object has the same props as the first.
Code:
...
<h4 for="jetsSearch">Search with your 2 letter state abbreviation:</h4>
<div class="input-group">
<span class="input-group-addon" id="basic-addon3">State: </span>
<input type="search" id="stateSearch" class="form-control" placeholder="NY">
<h4 for="nameSearch">Search by representative name:</h4>
</div>
<h4 for="nameSearch">Search by representative name:</h4>
<div class="input-group">
<span class="input-group-addon" id="basic-addon3">Name: </span>
<input type="search" id="nameSearch" class="form-control" placeholder="Maria">
</div>
...
<script type="text/javascript">
var jets = new Jets({ // searches column 2, containing state codes
searchTag: '#stateSearch',
contentTag: '#jetsContent',
columns: [2]
});
var jets2 = new Jets({ // expected: search col 1, containing names
searchTag: '#nameSearch', // actual: searches col 2, same config as above.
contentTag: '#jetsContent',
columns: [1]
});
</script>
I have a table of data that I want to be able to search by two columns at once.
See the table here.
It seems like this depends on the properties of the first jets object since either way, the second object has the same props as the first.
Code: