Skip to content

Commit

Permalink
Fixed race and renamed column for #1980
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Sep 17, 2024
1 parent 8139b7d commit af23b9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion grails-app/assets/javascripts/my-projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ var ProjectReportingViewModel = function (projects, options) {
return new ProjectReportsViewModel(prj.project);
});
self.projects(mappedProjects);
$(options.tableSelector).DataTable({displayLength:50, order:[[6,'desc']]});
// We need the projects to be rendered in the table before attaching the DataTable to it
setTimeout(function() {
$(options.tableSelector).DataTable({displayLength:50, order:[[6,'desc']]});
}, 0);

}
if (projects.length == 0) {
$.get(options.userProjectsUrl).done(function (projects) {
Expand Down
2 changes: 1 addition & 1 deletion grails-app/views/shared/_reports.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<table id="report" class="table">
<thead>
<tr>
<th class="sorting">Grant ID</th>
<th class="sorting">MERIT Project ID</th>
<th class="sorting">Programme</th>
<th class="sorting">Sub-programme</th>
<th class="sorting" width="30%">Project name</th>
Expand Down

0 comments on commit af23b9d

Please sign in to comment.