Skip to content

Commit

Permalink
allow selecting apps by category
Browse files Browse the repository at this point in the history
  • Loading branch information
nahrens007 committed Apr 8, 2019
1 parent bb34539 commit 497f539
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Bulk Mobile App Scoping/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ $("#checkAll").click(function() {

function categorySelect() {
var category=$("#catsel").val();
console.log(category);
$("tr.approw").each(function(index, element) {
var rowcat = $(element).children("td.catname").text().trim(); // get td with category
// console.log(element.childNodes[9].innerText);
var rowcat = element.childNodes[9].innerText; // get td with category
if (category == rowcat) {
$(element).children().get(0).children(0).prop("checked", true); // set the checkbox to checked
element.childNodes[1].childNodes[1].setAttribute("checked", true);
} else {
element.childNodes[1].childNodes[1].removeAttribute("checked");
}
});
}
2 changes: 1 addition & 1 deletion Bulk Mobile App Scoping/templates/apps.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1>App Management</h1>
<br>
<label>Select by category:</label>
<select id="catsel" name="selcat" onchange="categorySelect()">
<option value="None">None</option>
<option value="No category assigned">No category assigned</option>
{% for cat in categories %}
<option value="{{ cat.name }}">{{ cat.name }}</option>
{% endfor %}
Expand Down

0 comments on commit 497f539

Please sign in to comment.