Skip to content

Commit

Permalink
fix patient list table options to retrieve data via ajax
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen committed Sep 26, 2024
1 parent 93598aa commit 8fa52d1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions portal/templates/admin/patients_by_org.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ <h4 class="tnth-headline">{{_("Patient List")}}</h4>
data-unique-id="id"
data-id-field="id"
data-filter-control="true"
data-side-pagination="server"
data-ajax="ajaxRequest"
{%- if not isResearcher -%} data-show-export="true" {%- endif -%}
data-export-data-type="all"
>
Expand Down Expand Up @@ -164,6 +166,18 @@ <h4 class="modal-title">{{ _("Patient Report") }}</h4>
</div>
<div id="admin-table-error-message" class="text-danger smaller-text"></div>
{{ExportPopover()}}
<script>
// custom ajax request here
function ajaxRequest(params) {
console.log("data ? ", $.param(params.data));
//search=&sort=userid&order=desc&offset=0&limit=10
var url = "/patients";
$.get(url + '?' + $.param(params.data)).then(function (res) {
params.success(res)
});
}

</script>
</div>
{% endblock %}
{% block footer %}{{footer(user=user)}}{% endblock %}

0 comments on commit 8fa52d1

Please sign in to comment.