[FIX]candidate filter and search together with the filter tags
This commit is contained in:
@@ -22,5 +22,39 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#candidate-search").keyup(function (e) {
|
||||
$("#filterSearch").val($(this).val());
|
||||
});
|
||||
$(".filterButton").click(function (e) {
|
||||
const formData = $("#filterForm").serializeArray();
|
||||
const jsonObject = {};
|
||||
|
||||
$.each(formData, function() {
|
||||
jsonObject[this.name] = this.value;
|
||||
});
|
||||
var hxVals = JSON.stringify(jsonObject)
|
||||
$(".candidate-view-type").attr("hx-vals", hxVals);
|
||||
const { search, ...newObj } = jsonObject;
|
||||
$("#candidate-search").attr("hx-vals", JSON.stringify(newObj));
|
||||
});
|
||||
|
||||
$("#candidate-search").focusout(function (e) {
|
||||
const formData = $("#filterForm").serializeArray();
|
||||
const jsonObject = {};
|
||||
|
||||
$.each(formData, function() {
|
||||
jsonObject[this.name] = this.value;
|
||||
});
|
||||
var hxVals = JSON.stringify(jsonObject)
|
||||
$(".candidate-view-type").attr("hx-vals", hxVals);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,5 +1,6 @@
|
||||
{% load i18n %}
|
||||
<form hx-get='{% url "search-candidate" %}' id="filterForm" hx-target='#section'>
|
||||
<input type="hidden" name="search" id="filterSearch">
|
||||
<div class="oh-dropdown__filter-body">
|
||||
<div class="oh-accordion">
|
||||
<div class="oh-accordion-header">{% trans "Candidates" %}</div>
|
||||
|
||||
@@ -61,7 +61,6 @@ def dashboard(request):
|
||||
job_data = list(zip(all_job, initial, test, interview, hired))
|
||||
|
||||
recruitment_obj = Recruitment.objects.filter(closed=False)
|
||||
# print(recruitment_obj)
|
||||
|
||||
recruitment_manager_mapping = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user